@@ -10,8 +10,9 @@ Windows platform
1010function ( windows_options )
1111
1212 option ( GODOT_USE_STATIC_CPP "Link MinGW/MSVC C++ runtime libraries statically" ON )
13+ option ( GODOT_DEBUG_CRT "Compile with MSVC's debug CRT (/MDd)" OFF )
1314
14- # The below scons variables are controlled via toolchain files instead
15+ # The below scons variables are controlled via toolchain files instead
1516 # "mingw_prefix" "MinGW prefix"
1617 # "use_llvm" "Use the LLVM compiler (MVSC or MinGW depending on the use_mingw flag)"
1718 # "use_mingw" "Use the MinGW compiler instead of MSVC - only effective on Windows"
@@ -23,27 +24,20 @@ function( windows_generate TARGET_NAME )
2324 set ( NOT_MSVC "$<NOT:${IS_MSVC} >" )
2425 set ( STATIC_CPP "$<BOOL:${GODOT_USE_STATIC_CPP} >" )
2526 set ( DISABLE_EXCEPTIONS "$<BOOL:${GODOT_DISABLE_EXCEPTIONS} >" )
27+ set ( DEBUG_CRT "$<BOOL:${GODOT_DEBUG_CRT} >" )
2628
2729 set_target_properties ( ${TARGET_NAME}
2830 PROPERTIES
2931 PDB_OUTPUT_DIRECTORY "$<1:${CMAKE_SOURCE_DIR} /bin>"
32+ MSVC_RUNTIME_LIBRARY "$<IF:${DEBUG_CRT} ,MultiThreadedDebugDLL,$<IF:${STATIC_CPP} ,MultiThreaded,MultiThreadedDLL>>"
3033 )
3134
3235 target_compile_definitions ( ${TARGET_NAME}
3336 PUBLIC
3437 WINDOWS_ENABLED
35- $<${IS_MSVC} :
36- TYPED_METHOD_BIND
37- NOMINMAX
38- >
38+ $<${IS_MSVC} : TYPED_METHOD_BIND NOMINMAX >
3939 )
4040
41- target_compile_options ( ${TARGET_NAME}
42- PUBLIC
43- $<${IS_MSVC} :
44- $<IF:${STATIC_CPP} ,/MT,/MD >$<${IS_DEV} :d> # Link microsoft runtime
45- >
46- )
4741 target_link_options ( ${TARGET_NAME}
4842 PUBLIC
4943
0 commit comments