mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-13 08:06:12 +01:00
Add NO_WCHAR_T build option to CMake (#384)
This commit is contained in:
@@ -37,6 +37,8 @@ option(ENABLE_CODE_ANALYSIS "Use Static Code Analysis on build" OFF)
|
||||
|
||||
option(USE_PREBUILT_SHADERS "Use externally built HLSL shaders" OFF)
|
||||
|
||||
option(NO_WCHAR_T "Use legacy wide-character as unsigned short" OFF)
|
||||
|
||||
# Includes the functions for loading/saving OpenEXR files at runtime
|
||||
option(ENABLE_OPENEXR_SUPPORT "Build with OpenEXR support" OFF)
|
||||
|
||||
@@ -399,6 +401,13 @@ if(MSVC)
|
||||
target_link_options(${t} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NO_WCHAR_T)
|
||||
message(STATUS "Using non-native wchar_t as unsigned short")
|
||||
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
|
||||
target_compile_options(${t} PRIVATE "/Zc:wchar_t-")
|
||||
endforeach()
|
||||
endif()
|
||||
else()
|
||||
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
|
||||
target_compile_definitions(${t} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
|
||||
|
||||
Reference in New Issue
Block a user