@@ -102,46 +102,46 @@ endfunction()
102
102
function ( godotcpp_options )
103
103
#NOTE: platform is managed using toolchain files.
104
104
#NOTE: arch is managed by using toolchain files.
105
- # Except for macos universal, which can be set by GODOT_MACOS_UNIVERSAL =YES
105
+ # Except for macos universal, which can be set by GODOTCPP_MACOS_UNIVERSAL =YES
106
106
107
107
# Input from user for GDExtension interface header and the API JSON file
108
- set (GODOT_GDEXTENSION_DIR "gdextension" CACHE PATH
108
+ set ( GODOTCPP_GDEXTENSION_DIR "gdextension" CACHE PATH
109
109
"Path to a custom directory containing GDExtension interface header and API JSON file ( /path/to/gdextension_dir )" )
110
- set (GODOT_CUSTOM_API_FILE "" CACHE FILEPATH
111
- "Path to a custom GDExtension API JSON file (takes precedence over `GODOT_GDEXTENSION_DIR `) ( /path/to/custom_api_file )" )
110
+ set ( GODOTCPP_CUSTOM_API_FILE "" CACHE FILEPATH
111
+ "Path to a custom GDExtension API JSON file (takes precedence over `GODOTCPP_GDEXTENSION_DIR `) ( /path/to/custom_api_file )" )
112
112
113
113
#TODO generate_bindings
114
114
115
- option (GODOT_GENERATE_TEMPLATE_GET_NODE
115
+ option ( GODOTCPP_GENERATE_TEMPLATE_GET_NODE
116
116
"Generate a template version of the Node class's get_node. (ON|OFF)" ON )
117
117
118
118
#TODO build_library
119
119
120
- set (GODOT_PRECISION "single" CACHE STRING
120
+ set ( GODOTCPP_PRECISION "single" CACHE STRING
121
121
"Set the floating-point precision level (single|double)" )
122
122
123
- set ( GODOT_THREADS ON CACHE BOOL "Enable threading support" )
123
+ set ( GODOTCPP_THREADS ON CACHE BOOL "Enable threading support" )
124
124
125
125
#TODO compiledb
126
126
#TODO compiledb_file
127
127
128
- set ( GODOT_BUILD_PROFILE "" CACHE PATH
128
+ set ( GODOTCPP_BUILD_PROFILE "" CACHE PATH
129
129
"Path to a file containing a feature build profile" )
130
130
131
- set (GODOT_USE_HOT_RELOAD "" CACHE BOOL
131
+ set ( GODOTCPP_USE_HOT_RELOAD "" CACHE BOOL
132
132
"Enable the extra accounting required to support hot reload. (ON|OFF)" )
133
133
134
134
# Disable exception handling. Godot doesn't use exceptions anywhere, and this
135
135
# saves around 20% of binary size and very significant build time (GH-80513).
136
- option (GODOT_DISABLE_EXCEPTIONS "Force disabling exception handling code (ON|OFF)" ON )
136
+ option ( GODOTCPP_DISABLE_EXCEPTIONS "Force disabling exception handling code (ON|OFF)" ON )
137
137
138
- set ( GODOT_SYMBOL_VISIBILITY "hidden" CACHE STRING
138
+ set ( GODOTCPP_SYMBOL_VISIBILITY "hidden" CACHE STRING
139
139
"Symbols visibility on GNU platforms. Use 'auto' to apply the default value. (auto|visible|hidden)" )
140
- set_property ( CACHE GODOT_SYMBOL_VISIBILITY PROPERTY STRINGS "auto;visible;hidden" )
140
+ set_property ( CACHE GODOTCPP_SYMBOL_VISIBILITY PROPERTY STRINGS "auto;visible;hidden" )
141
141
142
142
#TODO optimize
143
143
144
- option ( GODOT_DEV_BUILD "Developer build with dev-only debugging code (DEV_ENABLED)" OFF )
144
+ option ( GODOTCPP_DEV_BUILD "Developer build with dev-only debugging code (DEV_ENABLED)" OFF )
145
145
146
146
#[[ debug_symbols
147
147
Debug symbols are enabled by using the Debug or RelWithDebInfo build configurations.
@@ -156,11 +156,11 @@ function( godotcpp_options )
156
156
]]
157
157
158
158
# FIXME These options are not present in SCons, and perhaps should be added there.
159
- option ( GODOT_SYSTEM_HEADERS "Expose headers as SYSTEM." OFF )
160
- option ( GODOT_WARNING_AS_ERROR "Treat warnings as errors" OFF )
159
+ option ( GODOTCPP_SYSTEM_HEADERS "Expose headers as SYSTEM." OFF )
160
+ option ( GODOTCPP_WARNING_AS_ERROR "Treat warnings as errors" OFF )
161
161
162
162
# Enable Testing
163
- option ( GODOT_ENABLE_TESTING "Enable the godot-cpp.test.<target> integration testing targets" OFF )
163
+ option ( GODOTCPP_ENABLE_TESTING "Enable the godot-cpp.test.<target> integration testing targets" OFF )
164
164
165
165
#[[ Target Platform Options ]]
166
166
android_options()
@@ -192,64 +192,64 @@ function( godotcpp_generate )
192
192
message ( " eg. cmake --build . -j 7 ..." )
193
193
endif ()
194
194
195
- #[[ GODOT_SYMBOL_VISIBLITY
195
+ #[[ GODOTCPP_SYMBOL_VISIBLITY
196
196
To match the SCons options, the allowed values are "auto", "visible", and "hidden"
197
197
This effects the compiler flag_ -fvisibility=[default|internal|hidden|protected]
198
198
The corresponding target option CXX_VISIBILITY_PRESET accepts the compiler values.
199
199
200
200
TODO: It is probably worth a pull request which changes both to use the compiler values
201
201
.. _flag:https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fvisibility
202
202
]]
203
- if ( ${GODOT_SYMBOL_VISIBILITY } STREQUAL "auto" OR ${GODOT_SYMBOL_VISIBILITY } STREQUAL "visible" )
204
- set ( GODOT_SYMBOL_VISIBILITY "default" )
203
+ if ( ${GODOTCPP_SYMBOL_VISIBILITY } STREQUAL "auto" OR ${GODOTCPP_SYMBOL_VISIBILITY } STREQUAL "visible" )
204
+ set ( GODOTCPP_SYMBOL_VISIBILITY "default" )
205
205
endif ()
206
206
207
207
# Setup variable to optionally mark headers as SYSTEM
208
- set (GODOT_SYSTEM_HEADERS_ATTRIBUTE "" )
209
- if (GODOT_SYSTEM_HEADERS )
210
- set (GODOT_SYSTEM_HEADERS_ATTRIBUTE SYSTEM )
208
+ set ( GODOTCPP_SYSTEM_HEADERS_ATTRIBUTE "" )
209
+ if ( GODOTCPP_SYSTEM_HEADERS )
210
+ set ( GODOTCPP_SYSTEM_HEADERS_ATTRIBUTE SYSTEM )
211
211
endif ()
212
212
213
213
#[[ Configure Binding Variables ]]
214
214
# Generate Binding Parameters (True|False)
215
215
set ( USE_TEMPLATE_GET_NODE "False" )
216
- if ( GODOT_GENERATE_TEMPLATE_GET_NODE )
216
+ if ( GODOTCPP_GENERATE_TEMPLATE_GET_NODE )
217
217
set ( USE_TEMPLATE_GET_NODE "True" )
218
218
endif ()
219
219
220
220
# Bits (32|64)
221
221
math ( EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8" ) # CMAKE_SIZEOF_VOID_P refers to target architecture.
222
222
223
223
# API json File
224
- set (GODOT_GDEXTENSION_API_FILE "${GODOT_GDEXTENSION_DIR } /extension_api.json" )
225
- if ( GODOT_CUSTOM_API_FILE ) # User-defined override.
226
- set (GODOT_GDEXTENSION_API_FILE "${GODOT_CUSTOM_API_FILE } " )
224
+ set ( GODOTCPP_GDEXTENSION_API_FILE "${GODOTCPP_GDEXTENSION_DIR } /extension_api.json" )
225
+ if ( GODOTCPP_CUSTOM_API_FILE ) # User-defined override.
226
+ set ( GODOTCPP_GDEXTENSION_API_FILE "${GODOTCPP_CUSTOM_API_FILE } " )
227
227
endif ()
228
228
229
229
# Build Profile
230
- if ( GODOT_BUILD_PROFILE )
230
+ if ( GODOTCPP_BUILD_PROFILE )
231
231
message ( STATUS "Using build profile to trim api file" )
232
- message ( "\t BUILD_PROFILE = '${GODOT_BUILD_PROFILE } '" )
233
- message ( "\t API_SOURCE = '${GODOT_GDEXTENSION_API_FILE } '" )
232
+ message ( "\t BUILD_PROFILE = '${GODOTCPP_BUILD_PROFILE } '" )
233
+ message ( "\t API_SOURCE = '${GODOTCPP_GDEXTENSION_API_FILE } '" )
234
234
build_profile_generate_trimmed_api(
235
- "${GODOT_BUILD_PROFILE } "
236
- "${GODOT_GDEXTENSION_API_FILE } "
235
+ "${GODOTCPP_BUILD_PROFILE } "
236
+ "${GODOTCPP_GDEXTENSION_API_FILE } "
237
237
"${CMAKE_CURRENT_BINARY_DIR} /extension_api.json" )
238
- set ( GODOT_GDEXTENSION_API_FILE "${CMAKE_CURRENT_BINARY_DIR} /extension_api.json" )
238
+ set ( GODOTCPP_GDEXTENSION_API_FILE "${CMAKE_CURRENT_BINARY_DIR} /extension_api.json" )
239
239
endif ()
240
240
241
- message ( STATUS "GODOT_GDEXTENSION_API_FILE = '${GODOT_GDEXTENSION_API_FILE } '" )
241
+ message ( STATUS "GODOTCPP_GDEXTENSION_API_FILE = '${GODOTCPP_GDEXTENSION_API_FILE } '" )
242
242
243
243
# generate the file list to use
244
244
binding_generator_get_file_list( GENERATED_FILES_LIST
245
- "${GODOT_GDEXTENSION_API_FILE } "
245
+ "${GODOTCPP_GDEXTENSION_API_FILE } "
246
246
"${CMAKE_CURRENT_BINARY_DIR} " )
247
247
248
248
binding_generator_generate_bindings(
249
- "${GODOT_GDEXTENSION_API_FILE } "
249
+ "${GODOTCPP_GDEXTENSION_API_FILE } "
250
250
"${USE_TEMPLATE_GET_NODE} "
251
251
"${BITS} "
252
- "${GODOT_PRECISION } "
252
+ "${GODOTCPP_PRECISION } "
253
253
"${CMAKE_CURRENT_BINARY_DIR} " )
254
254
255
255
add_custom_target ( godot-cpp.generate_bindings DEPENDS ${GENERATED_FILES_LIST} )
@@ -271,36 +271,36 @@ function( godotcpp_generate )
271
271
godot_arch_name( ARCH_NAME )
272
272
273
273
# Transform options into generator expressions
274
- set ( HOT_RELOAD-UNSET "$<STREQUAL:${GODOT_USE_HOT_RELOAD } ,>" )
274
+ set ( HOT_RELOAD-UNSET "$<STREQUAL:${GODOTCPP_USE_HOT_RELOAD } ,>" )
275
275
276
- set ( DISABLE_EXCEPTIONS "$<BOOL:${GODOT_DISABLE_EXCEPTIONS } >" )
276
+ set ( DISABLE_EXCEPTIONS "$<BOOL:${GODOTCPP_DISABLE_EXCEPTIONS } >" )
277
277
278
- set ( THREADS_ENABLED "$<BOOL:${GODOT_THREADS } >" )
278
+ set ( THREADS_ENABLED "$<BOOL:${GODOTCPP_THREADS } >" )
279
279
280
- # GODOT_DEV_BUILD
280
+ # GODOTCPP_DEV_BUILD
281
281
set ( RELEASE_TYPES "Release;MinSizeRel" )
282
282
get_property ( IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG )
283
283
if ( IS_MULTI_CONFIG )
284
284
message ( NOTICE "=> Default build type is Debug. For other build types add --config <type> to build command" )
285
- elseif ( GODOT_DEV_BUILD AND CMAKE_BUILD_TYPE IN_LIST RELEASE_TYPES )
286
- message ( WARNING "=> GODOT_DEV_BUILD implies a Debug-like build but CMAKE_BUILD_TYPE is '${CMAKE_BUILD_TYPE} '" )
285
+ elseif ( GODOTCPP_DEV_BUILD AND CMAKE_BUILD_TYPE IN_LIST RELEASE_TYPES )
286
+ message ( WARNING "=> GODOTCPP_DEV_BUILD implies a Debug-like build but CMAKE_BUILD_TYPE is '${CMAKE_BUILD_TYPE} '" )
287
287
endif ()
288
- set ( IS_DEV_BUILD "$<BOOL:${GODOT_DEV_BUILD } >" )
288
+ set ( IS_DEV_BUILD "$<BOOL:${GODOTCPP_DEV_BUILD } >" )
289
289
290
290
### Define our godot-cpp library targets
291
291
foreach ( TARGET_ALIAS template_debug template_release editor )
292
292
set ( TARGET_NAME "godot-cpp.${TARGET_ALIAS} " )
293
293
294
294
# Generator Expressions that rely on the target
295
295
set ( DEBUG_FEATURES "$<NOT:$<STREQUAL:${TARGET_ALIAS} ,template_release>>" )
296
- set ( HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},${DEBUG_FEATURES} ,$<BOOL:${GODOT_USE_HOT_RELOAD } >>" )
296
+ set ( HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},${DEBUG_FEATURES} ,$<BOOL:${GODOTCPP_USE_HOT_RELOAD } >>" )
297
297
298
298
# Suffix
299
- string ( CONCAT GODOT_SUFFIX
299
+ string ( CONCAT GODOTCPP_SUFFIX
300
300
"$<1:.${SYSTEM_NAME} >"
301
301
"$<1:.${TARGET_ALIAS} >"
302
302
"$<${IS_DEV_BUILD} :.dev>"
303
- "$<$<STREQUAL:${GODOT_PRECISION } ,double>:.double>"
303
+ "$<$<STREQUAL:${GODOTCPP_PRECISION } ,double>:.double>"
304
304
"$<1:.${ARCH_NAME} >"
305
305
# TODO IOS_SIMULATOR
306
306
"$<$<NOT:${THREADS_ENABLED} >:.nothreads>"
@@ -318,33 +318,33 @@ function( godotcpp_generate )
318
318
${GENERATED_FILES_LIST}
319
319
)
320
320
321
- target_include_directories ( ${TARGET_NAME} ${GODOT_SYSTEM_HEADERS_ATTRIBUTE } PUBLIC
321
+ target_include_directories ( ${TARGET_NAME} ${GODOTCPP_SYSTEM_HEADERS_ATTRIBUTE } PUBLIC
322
322
include
323
323
${CMAKE_CURRENT_BINARY_DIR} /gen/include
324
- ${GODOT_GDEXTENSION_DIR }
324
+ ${GODOTCPP_GDEXTENSION_DIR }
325
325
)
326
326
327
327
set_target_properties ( ${TARGET_NAME}
328
328
PROPERTIES
329
329
CXX_STANDARD 17
330
330
CXX_EXTENSIONS OFF
331
- CXX_VISIBILITY_PRESET ${GODOT_SYMBOL_VISIBILITY }
331
+ CXX_VISIBILITY_PRESET ${GODOTCPP_SYMBOL_VISIBILITY }
332
332
333
- COMPILE_WARNING_AS_ERROR ${GODOT_WARNING_AS_ERROR }
333
+ COMPILE_WARNING_AS_ERROR ${GODOTCPP_WARNING_AS_ERROR }
334
334
POSITION_INDEPENDENT_CODE ON
335
335
BUILD_RPATH_USE_ORIGIN ON
336
336
337
337
PREFIX "lib"
338
- OUTPUT_NAME "${PROJECT_NAME}${GODOT_SUFFIX } "
338
+ OUTPUT_NAME "${PROJECT_NAME}${GODOTCPP_SUFFIX } "
339
339
340
340
ARCHIVE_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR} /bin>"
341
341
342
342
# Things that are handy to know for dependent targets
343
- GODOT_PLATFORM "${SYSTEM_NAME} "
344
- GODOT_TARGET "${TARGET_ALIAS} "
345
- GODOT_ARCH "${ARCH_NAME} "
346
- GODOT_PRECISION "${GODOT_PRECISION } "
347
- GODOT_SUFFIX "${GODOT_SUFFIX } "
343
+ GODOTCPP_PLATFORM "${SYSTEM_NAME} "
344
+ GODOTCPP_TARGET "${TARGET_ALIAS} "
345
+ GODOTCPP_ARCH "${ARCH_NAME} "
346
+ GODOTCPP_PRECISION "${GODOTCPP_PRECISION } "
347
+ GODOTCPP_SUFFIX "${GODOTCPP_SUFFIX } "
348
348
349
349
# Some IDE's respect this property to logically group targets
350
350
FOLDER "godot-cpp"
0 commit comments