Skip to content

Commit 452a0e7

Browse files
authored
Merge pull request #11381 from Calinou/gdextension-file-libraries-relative-path
Document relative paths in `.gdextension` files being supported
2 parents 9e75449 + 9420053 commit 452a0e7

File tree

2 files changed

+48
-36
lines changed

2 files changed

+48
-36
lines changed

tutorials/scripting/cpp/gdextension_cpp_example.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -338,18 +338,18 @@ loaded for each platform and the entry function for the module. It is called ``g
338338
339339
[libraries]
340340
341-
macos.debug = "res://bin/libgdexample.macos.template_debug.framework"
342-
macos.release = "res://bin/libgdexample.macos.template_release.framework"
343-
windows.debug.x86_32 = "res://bin/libgdexample.windows.template_debug.x86_32.dll"
344-
windows.release.x86_32 = "res://bin/libgdexample.windows.template_release.x86_32.dll"
345-
windows.debug.x86_64 = "res://bin/libgdexample.windows.template_debug.x86_64.dll"
346-
windows.release.x86_64 = "res://bin/libgdexample.windows.template_release.x86_64.dll"
347-
linux.debug.x86_64 = "res://bin/libgdexample.linux.template_debug.x86_64.so"
348-
linux.release.x86_64 = "res://bin/libgdexample.linux.template_release.x86_64.so"
349-
linux.debug.arm64 = "res://bin/libgdexample.linux.template_debug.arm64.so"
350-
linux.release.arm64 = "res://bin/libgdexample.linux.template_release.arm64.so"
351-
linux.debug.rv64 = "res://bin/libgdexample.linux.template_debug.rv64.so"
352-
linux.release.rv64 = "res://bin/libgdexample.linux.template_release.rv64.so"
341+
macos.debug = "./bin/libgdexample.macos.template_debug.dylib"
342+
macos.release = "./bin/libgdexample.macos.template_release.dylib"
343+
windows.debug.x86_32 = "./bin/libgdexample.windows.template_debug.x86_32.dll"
344+
windows.release.x86_32 = "./bin/libgdexample.windows.template_release.x86_32.dll"
345+
windows.debug.x86_64 = "./bin/libgdexample.windows.template_debug.x86_64.dll"
346+
windows.release.x86_64 = "./bin/libgdexample.windows.template_release.x86_64.dll"
347+
linux.debug.x86_64 = "./bin/libgdexample.linux.template_debug.x86_64.so"
348+
linux.release.x86_64 = "./bin/libgdexample.linux.template_release.x86_64.so"
349+
linux.debug.arm64 = "./bin/libgdexample.linux.template_debug.arm64.so"
350+
linux.release.arm64 = "./bin/libgdexample.linux.template_release.arm64.so"
351+
linux.debug.rv64 = "./bin/libgdexample.linux.template_debug.rv64.so"
352+
linux.release.rv64 = "./bin/libgdexample.linux.template_release.rv64.so"
353353
354354
This file contains a ``configuration`` section that controls the entry function of the module.
355355
You should also set the minimum compatible Godot version with ``compatibility_minimum``,

tutorials/scripting/gdextension/gdextension_file.rst

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,25 @@ Here is an example of what that can look like:
5050

5151
.. code-block:: none
5252
53+
; A comment line starts with a semicolon. This line is ignored by the engine.
5354
[libraries]
5455
55-
macos.debug = "res://bin/libgdexample.macos.template_debug.framework"
56-
macos.release = "res://bin/libgdexample.macos.template_release.framework"
57-
windows.debug.x86_32 = "res://bin/libgdexample.windows.template_debug.x86_32.dll"
58-
windows.release.x86_32 = "res://bin/libgdexample.windows.template_release.x86_32.dll"
59-
windows.debug.x86_64 = "res://bin/libgdexample.windows.template_debug.x86_64.dll"
60-
windows.release.x86_64 = "res://bin/libgdexample.windows.template_release.x86_64.dll"
61-
linux.debug.x86_64 = "res://bin/libgdexample.linux.template_debug.x86_64.so"
62-
linux.release.x86_64 = "res://bin/libgdexample.linux.template_release.x86_64.so"
63-
linux.debug.arm64 = "res://bin/libgdexample.linux.template_debug.arm64.so"
64-
linux.release.arm64 = "res://bin/libgdexample.linux.template_release.arm64.so"
65-
linux.debug.rv64 = "res://bin/libgdexample.linux.template_debug.rv64.so"
66-
linux.release.rv64 = "res://bin/libgdexample.linux.template_release.rv64.so"
67-
56+
macos.debug = "./bin/libgdexample.macos.template_debug.dylib" ; Inline comments are also allowed.
57+
macos.release = "./bin/libgdexample.macos.template_release.dylib"
58+
windows.debug.x86_32 = "./bin/libgdexample.windows.template_debug.x86_32.dll"
59+
windows.release.x86_32 = "./bin/libgdexample.windows.template_release.x86_32.dll"
60+
windows.debug.x86_64 = "./bin/libgdexample.windows.template_debug.x86_64.dll"
61+
windows.release.x86_64 = "./bin/libgdexample.windows.template_release.x86_64.dll"
62+
linux.debug.x86_64 = "./bin/libgdexample.linux.template_debug.x86_64.so"
63+
linux.release.x86_64 = "./bin/libgdexample.linux.template_release.x86_64.so"
64+
linux.debug.arm64 = "./bin/libgdexample.linux.template_debug.arm64.so"
65+
linux.release.arm64 = "./bin/libgdexample.linux.template_release.arm64.so"
66+
linux.debug.rv64 = "./bin/libgdexample.linux.template_debug.rv64.so"
67+
linux.release.rv64 = "./bin/libgdexample.linux.template_release.rv64.so"
68+
69+
Paths can be relative or absolute (starting with ``res://``). Relative paths are recommended,
70+
as they allow the extension to keep working if it's installed to a different folder than what's
71+
specified in the path.
6872

6973
Entries are matched in order, so if two sets of feature tags could match
7074
the same system, be sure to put the more specific ones first:
@@ -73,8 +77,8 @@ the same system, be sure to put the more specific ones first:
7377
7478
[libraries]
7579
76-
linux.release.editor.x86_64 = "res://bin/libgdexample.linux.template_release.x86_64.so"
77-
linux.release.x86_64 = "res://bin/libgdexample.linux.noeditor.template_release.x86_64.so"
80+
linux.release.editor.x86_64 = "./bin/libgdexample.linux.template_release.x86_64.so"
81+
linux.release.x86_64 = "./bin/libgdexample.linux.noeditor.template_release.x86_64.so"
7882
7983
Here are lists of some of the available built-in options (for more look at the :ref:`feature tags <doc_feature_tags>`):
8084

@@ -107,9 +111,9 @@ Build
107111
+-------------------------------+------------------------------------------------------------------------------------------------------+
108112
| Flag | Description |
109113
+===============================+======================================================================================================+
110-
| **debug** | Build with debug symbols |
114+
| **debug** | Build with debugging features (editor builds always have debugging features) |
111115
+-------------------------------+------------------------------------------------------------------------------------------------------+
112-
| **release** | Optimized build without debug symbols |
116+
| **release** | Optimized build without debugging features |
113117
+-------------------------------+------------------------------------------------------------------------------------------------------+
114118
| **editor** | Editor build |
115119
+-------------------------------+------------------------------------------------------------------------------------------------------+
@@ -138,8 +142,8 @@ Architecture
138142
Icons section
139143
-------------
140144

141-
By default, Godot uses the Node icon in the scene dock for GDExtension nodes. A custom icon can be
142-
set by reference to its name and resource path of an SVG file.
145+
By default, Godot uses the Node icon in the scene dock for GDExtension nodes.
146+
A custom icon can be set by reference to its name and resource path of an SVG file.
143147

144148
For example:
145149

@@ -149,20 +153,28 @@ For example:
149153
150154
GDExample = "res://icons/gd_example.svg"
151155
152-
The path should point to a 16 by 16 pixel SVG image. Read the guide for :ref:`creating icons <doc_editor_icons>`
156+
The path should point to a 16×16 pixel SVG image, with two options enabled on the
157+
image in the Import dock:
158+
159+
- **Editor > Scale with Editor Scale**.
160+
- **Editor > Convert Colors with Editor Theme**.
161+
162+
Enabling both options ensures the icon behaves as closely as possible to
163+
the stock editor icons. Read the guide for :ref:`creating icons <doc_editor_icons>`
153164
for more information.
154165

155166
Dependencies section
156167
--------------------
157168

158-
In this section you set the paths of the GDExtension dependencies. This is used internally to export the dependencies
169+
In this section, you set the paths of the GDExtension dependencies. This is used internally to export the dependencies
159170
when exporting your game executable. You are able to set which dependency is loaded depending on the feature flags
160171
of the exported executable. In addition, you are able to set an optional subdirectory to move your dependencies into.
161-
If no path is supplied Godot will move the libraries into the same directory as your game executable.
172+
If no path is supplied, Godot will move the libraries into the same directory as your game executable.
162173

163174
.. warning::
164-
In MacOS it is necessary to have shared libraries inside a folder called ``Frameworks`` with a directory structure
165-
like this: ``Game.app/Contents/Frameworks``.
175+
176+
On macOS, it is necessary to have shared libraries inside a folder called ``Frameworks``
177+
with a directory structure like this: ``Game.app/Contents/Frameworks``.
166178

167179
.. code-block:: none
168180

0 commit comments

Comments
 (0)