File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ SET(GDEXTENSION_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/project/addons/orchestrato
23
23
# ADD_COMPILE_DEFINITIONS(HOT_RELOAD_ENABLED)
24
24
add_compile_definitions (TOOLS_ENABLED)
25
25
26
+ set (FLOAT_PRECISION "single" CACHE STRING "" )
27
+
26
28
OPTION (
27
29
AUTOFORMAT_SRC_ON_CONFIGURE
28
30
"If enabled, clang-format will be used to format all sources in src/ during configuration"
@@ -93,6 +95,10 @@ FILE(GLOB_RECURSE gdext_sources
93
95
"${CMAKE_BINARY_DIR} /_generated/*.cpp"
94
96
)
95
97
98
+ if ("${FLOAT_PRECISION} " STREQUAL "double" )
99
+ add_compile_definitions (REAL_T_IS_DOUBLE)
100
+ endif ()
101
+
96
102
# GDExtension library
97
103
ADD_LIBRARY (${PROJECT_NAME} SHARED ${gdext_sources} )
98
104
@@ -104,6 +110,7 @@ TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PUBLIC
104
110
$<${compiler_is_msvc} :
105
111
/EHsc
106
112
/utf-8
113
+ $<$<STREQUAL :${FLOAT_PRECISION} ,double>:/DREAL_T_IS_DOUBLE>
107
114
/Zc:preprocessor
108
115
/wd5054 # operator '|' deprecated between enumerations of different types
109
116
$<$<CONFIG:Debug>:
@@ -186,7 +193,11 @@ ELSE ()
186
193
ENDIF ()
187
194
ENDIF ()
188
195
189
- STRING (TOLOWER "${PROJECT_NAME} .${CMAKE_SYSTEM_NAME} .${system_bits} .${CMAKE_BUILD_TYPE} " gde_lib_name)
196
+ if ("${FLOAT_PRECISION} " STREQUAL "double" )
197
+ STRING (TOLOWER "${PROJECT_NAME} .${CMAKE_SYSTEM_NAME} .${system_bits} .double.${CMAKE_BUILD_TYPE} " gde_lib_name)
198
+ ELSE ()
199
+ STRING (TOLOWER "${PROJECT_NAME} .${CMAKE_SYSTEM_NAME} .${system_bits} .${CMAKE_BUILD_TYPE} " gde_lib_name)
200
+ ENDIF ()
190
201
191
202
# Generate library resource
192
203
IF (WIN32 )
You can’t perform that action at this time.
0 commit comments