Skip to content

Commit a5fde40

Browse files
committed
Doc: document EMBED_RESOURCE_FILES and USE_ONLY_EMBEDDED_RESOURCE_FILES
1 parent e80cf53 commit a5fde40

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

doc/source/development/building_from_source.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,36 @@ All cached entries can be viewed using ``cmake -LAH`` from a build directory.
224224
`CMAKE_SKIP_INSTALL_RPATH <https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_INSTALL_RPATH.html>`__
225225
variable is not set.
226226

227+
Resource files embedding
228+
++++++++++++++++++++++++
229+
230+
Starting with GDAL 3.11, if a C23-compatible compiler is used, such as
231+
clang >= 19 or GCC >= 15, it is possible to embed resource files inside
232+
the GDAL library, without relying on resource files to be available on the file
233+
system (such resource files are located through an hard-coded
234+
path at build time in ``${CMAKE_INSTALL_PREFIX}/share/gdal``, or at run-time
235+
through the :config:`GDAL_DATA` configuration option).
236+
237+
The following CMake options control that behavior:
238+
239+
.. option:: EMBED_RESOURCE_FILES=ON/OFF
240+
241+
.. versionadded:: 3.11
242+
243+
Default is OFF for shared library builds (BUILD_SHARED_LIBS=ON), and ON
244+
for static library builds (BUILD_SHARED_LIBS=OFF).
245+
When ON, resource files needed by GDAL will be embedded into the GDAL library
246+
and/or relevant plugins.
247+
248+
.. option:: USE_ONLY_EMBEDDED_RESOURCE_FILES=ON/OFF
249+
250+
.. versionadded:: 3.11
251+
252+
Even if EMBED_RESOURCE_FILES=ON, GDAL will still try to locate resource
253+
files on the file system by default , and fallback to the embedded version if
254+
not found. By setting USE_ONLY_EMBEDDED_RESOURCE_FILES=ON, no attempt
255+
at locating resource files on the file system is made. Default is OFF.
256+
227257
CMake package dependent options
228258
+++++++++++++++++++++++++++++++
229259

doc/source/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ cid
369369
CInt
370370
circularstrings
371371
ClampRequests
372+
clang
372373
ClassificationCode
373374
Clayers
374375
CleanTimeout

0 commit comments

Comments
 (0)