@@ -102,46 +102,46 @@ endfunction()
102102function ( godotcpp_options )
103103 #NOTE: platform is managed using toolchain files.
104104 #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
106106
107107 # 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
109109 "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 )" )
112112
113113 #TODO generate_bindings
114114
115- option (GODOT_GENERATE_TEMPLATE_GET_NODE
115+ option ( GODOTCPP_GENERATE_TEMPLATE_GET_NODE
116116 "Generate a template version of the Node class's get_node. (ON|OFF)" ON )
117117
118118 #TODO build_library
119119
120- set (GODOT_PRECISION "single" CACHE STRING
120+ set ( GODOTCPP_PRECISION "single" CACHE STRING
121121 "Set the floating-point precision level (single|double)" )
122122
123- set ( GODOT_THREADS ON CACHE BOOL "Enable threading support" )
123+ set ( GODOTCPP_THREADS ON CACHE BOOL "Enable threading support" )
124124
125125 #TODO compiledb
126126 #TODO compiledb_file
127127
128- set ( GODOT_BUILD_PROFILE "" CACHE PATH
128+ set ( GODOTCPP_BUILD_PROFILE "" CACHE PATH
129129 "Path to a file containing a feature build profile" )
130130
131- set (GODOT_USE_HOT_RELOAD "" CACHE BOOL
131+ set ( GODOTCPP_USE_HOT_RELOAD "" CACHE BOOL
132132 "Enable the extra accounting required to support hot reload. (ON|OFF)" )
133133
134134 # Disable exception handling. Godot doesn't use exceptions anywhere, and this
135135 # 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 )
137137
138- set ( GODOT_SYMBOL_VISIBILITY "hidden" CACHE STRING
138+ set ( GODOTCPP_SYMBOL_VISIBILITY "hidden" CACHE STRING
139139 "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" )
141141
142142 #TODO optimize
143143
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 )
145145
146146 #[[ debug_symbols
147147 Debug symbols are enabled by using the Debug or RelWithDebInfo build configurations.
@@ -156,11 +156,11 @@ function( godotcpp_options )
156156 ]]
157157
158158 # 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 )
161161
162162 # 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 )
164164
165165 #[[ Target Platform Options ]]
166166 android_options()
@@ -192,64 +192,64 @@ function( godotcpp_generate )
192192 message ( " eg. cmake --build . -j 7 ..." )
193193 endif ()
194194
195- #[[ GODOT_SYMBOL_VISIBLITY
195+ #[[ GODOTCPP_SYMBOL_VISIBLITY
196196 To match the SCons options, the allowed values are "auto", "visible", and "hidden"
197197 This effects the compiler flag_ -fvisibility=[default|internal|hidden|protected]
198198 The corresponding target option CXX_VISIBILITY_PRESET accepts the compiler values.
199199
200200 TODO: It is probably worth a pull request which changes both to use the compiler values
201201 .. _flag:https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fvisibility
202202 ]]
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" )
205205 endif ()
206206
207207 # 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 )
211211 endif ()
212212
213213 #[[ Configure Binding Variables ]]
214214 # Generate Binding Parameters (True|False)
215215 set ( USE_TEMPLATE_GET_NODE "False" )
216- if ( GODOT_GENERATE_TEMPLATE_GET_NODE )
216+ if ( GODOTCPP_GENERATE_TEMPLATE_GET_NODE )
217217 set ( USE_TEMPLATE_GET_NODE "True" )
218218 endif ()
219219
220220 # Bits (32|64)
221221 math ( EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8" ) # CMAKE_SIZEOF_VOID_P refers to target architecture.
222222
223223 # 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 } " )
227227 endif ()
228228
229229 # Build Profile
230- if ( GODOT_BUILD_PROFILE )
230+ if ( GODOTCPP_BUILD_PROFILE )
231231 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 } '" )
234234 build_profile_generate_trimmed_api(
235- "${GODOT_BUILD_PROFILE } "
236- "${GODOT_GDEXTENSION_API_FILE } "
235+ "${GODOTCPP_BUILD_PROFILE } "
236+ "${GODOTCPP_GDEXTENSION_API_FILE } "
237237 "${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" )
239239 endif ()
240240
241- message ( STATUS "GODOT_GDEXTENSION_API_FILE = '${GODOT_GDEXTENSION_API_FILE } '" )
241+ message ( STATUS "GODOTCPP_GDEXTENSION_API_FILE = '${GODOTCPP_GDEXTENSION_API_FILE } '" )
242242
243243 # generate the file list to use
244244 binding_generator_get_file_list( GENERATED_FILES_LIST
245- "${GODOT_GDEXTENSION_API_FILE } "
245+ "${GODOTCPP_GDEXTENSION_API_FILE } "
246246 "${CMAKE_CURRENT_BINARY_DIR} " )
247247
248248 binding_generator_generate_bindings(
249- "${GODOT_GDEXTENSION_API_FILE } "
249+ "${GODOTCPP_GDEXTENSION_API_FILE } "
250250 "${USE_TEMPLATE_GET_NODE} "
251251 "${BITS} "
252- "${GODOT_PRECISION } "
252+ "${GODOTCPP_PRECISION } "
253253 "${CMAKE_CURRENT_BINARY_DIR} " )
254254
255255 ### Platform is derived from the toolchain target
@@ -268,36 +268,36 @@ function( godotcpp_generate )
268268 godot_arch_name( ARCH_NAME )
269269
270270 # Transform options into generator expressions
271- set ( HOT_RELOAD-UNSET "$<STREQUAL:${GODOT_USE_HOT_RELOAD } ,>" )
271+ set ( HOT_RELOAD-UNSET "$<STREQUAL:${GODOTCPP_USE_HOT_RELOAD } ,>" )
272272
273- set ( DISABLE_EXCEPTIONS "$<BOOL:${GODOT_DISABLE_EXCEPTIONS } >" )
273+ set ( DISABLE_EXCEPTIONS "$<BOOL:${GODOTCPP_DISABLE_EXCEPTIONS } >" )
274274
275- set ( THREADS_ENABLED "$<BOOL:${GODOT_THREADS } >" )
275+ set ( THREADS_ENABLED "$<BOOL:${GODOTCPP_THREADS } >" )
276276
277- # GODOT_DEV_BUILD
277+ # GODOTCPP_DEV_BUILD
278278 set ( RELEASE_TYPES "Release;MinSizeRel" )
279279 get_property ( IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG )
280280 if ( IS_MULTI_CONFIG )
281281 message ( NOTICE "=> Default build type is Debug. For other build types add --config <type> to build command" )
282- elseif ( GODOT_DEV_BUILD AND CMAKE_BUILD_TYPE IN_LIST RELEASE_TYPES )
283- message ( WARNING "=> GODOT_DEV_BUILD implies a Debug-like build but CMAKE_BUILD_TYPE is '${CMAKE_BUILD_TYPE} '" )
282+ elseif ( GODOTCPP_DEV_BUILD AND CMAKE_BUILD_TYPE IN_LIST RELEASE_TYPES )
283+ message ( WARNING "=> GODOTCPP_DEV_BUILD implies a Debug-like build but CMAKE_BUILD_TYPE is '${CMAKE_BUILD_TYPE} '" )
284284 endif ()
285- set ( IS_DEV_BUILD "$<BOOL:${GODOT_DEV_BUILD } >" )
285+ set ( IS_DEV_BUILD "$<BOOL:${GODOTCPP_DEV_BUILD } >" )
286286
287287 ### Define our godot-cpp library targets
288288 foreach ( TARGET_ALIAS template_debug template_release editor )
289289 set ( TARGET_NAME "godot-cpp.${TARGET_ALIAS} " )
290290
291291 # Generator Expressions that rely on the target
292292 set ( DEBUG_FEATURES "$<NOT:$<STREQUAL:${TARGET_ALIAS} ,template_release>>" )
293- set ( HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},${DEBUG_FEATURES} ,$<BOOL:${GODOT_USE_HOT_RELOAD } >>" )
293+ set ( HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},${DEBUG_FEATURES} ,$<BOOL:${GODOTCPP_USE_HOT_RELOAD } >>" )
294294
295295 # Suffix
296- string ( CONCAT GODOT_SUFFIX
296+ string ( CONCAT GODOTCPP_SUFFIX
297297 "$<1:.${SYSTEM_NAME} >"
298298 "$<1:.${TARGET_ALIAS} >"
299299 "$<${IS_DEV_BUILD} :.dev>"
300- "$<$<STREQUAL:${GODOT_PRECISION } ,double>:.double>"
300+ "$<$<STREQUAL:${GODOTCPP_PRECISION } ,double>:.double>"
301301 "$<1:.${ARCH_NAME} >"
302302 # TODO IOS_SIMULATOR
303303 "$<$<NOT:${THREADS_ENABLED} >:.nothreads>"
@@ -315,33 +315,33 @@ function( godotcpp_generate )
315315 ${GENERATED_FILES_LIST}
316316 )
317317
318- target_include_directories ( ${TARGET_NAME} ${GODOT_SYSTEM_HEADERS_ATTRIBUTE } PUBLIC
318+ target_include_directories ( ${TARGET_NAME} ${GODOTCPP_SYSTEM_HEADERS_ATTRIBUTE } PUBLIC
319319 include
320320 ${CMAKE_CURRENT_BINARY_DIR} /gen/include
321- ${GODOT_GDEXTENSION_DIR }
321+ ${GODOTCPP_GDEXTENSION_DIR }
322322 )
323323
324324 set_target_properties ( ${TARGET_NAME}
325325 PROPERTIES
326326 CXX_STANDARD 17
327327 CXX_EXTENSIONS OFF
328- CXX_VISIBILITY_PRESET ${GODOT_SYMBOL_VISIBILITY }
328+ CXX_VISIBILITY_PRESET ${GODOTCPP_SYMBOL_VISIBILITY }
329329
330- COMPILE_WARNING_AS_ERROR ${GODOT_WARNING_AS_ERROR }
330+ COMPILE_WARNING_AS_ERROR ${GODOTCPP_WARNING_AS_ERROR }
331331 POSITION_INDEPENDENT_CODE ON
332332 BUILD_RPATH_USE_ORIGIN ON
333333
334334 PREFIX "lib"
335- OUTPUT_NAME "${PROJECT_NAME}${GODOT_SUFFIX } "
335+ OUTPUT_NAME "${PROJECT_NAME}${GODOTCPP_SUFFIX } "
336336
337337 ARCHIVE_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR} /bin>"
338338
339339 # Things that are handy to know for dependent targets
340- GODOT_PLATFORM "${SYSTEM_NAME} "
341- GODOT_TARGET "${TARGET_ALIAS} "
342- GODOT_ARCH "${ARCH_NAME} "
343- GODOT_PRECISION "${GODOT_PRECISION } "
344- GODOT_SUFFIX "${GODOT_SUFFIX } "
340+ GODOTCPP_PLATFORM "${SYSTEM_NAME} "
341+ GODOTCPP_TARGET "${TARGET_ALIAS} "
342+ GODOTCPP_ARCH "${ARCH_NAME} "
343+ GODOTCPP_PRECISION "${GODOTCPP_PRECISION } "
344+ GODOTCPP_SUFFIX "${GODOTCPP_SUFFIX } "
345345
346346 # Some IDE's respect this property to logically group targets
347347 FOLDER "godot-cpp"
0 commit comments