This commit is contained in:
Chuck Walbourn 2022-03-23 16:57:17 -07:00
Родитель cce91c69fd
Коммит 7c963a14d1
1 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -31,6 +31,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/CMake")
if (DEFINED VCPKG_TARGET_ARCHITECTURE) if (DEFINED VCPKG_TARGET_ARCHITECTURE)
set(DIRECTX_ARCH ${VCPKG_TARGET_ARCHITECTURE}) set(DIRECTX_ARCH ${VCPKG_TARGET_ARCHITECTURE})
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$")
set(DIRECTX_ARCH x86)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$")
set(DIRECTX_ARCH x64)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$")
set(DIRECTX_ARCH arm)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$")
set(DIRECTX_ARCH arm64)
endif() endif()
#--- Library #--- Library
@ -270,15 +278,19 @@ if(BUILD_TOOLS AND (NOT WINDOWS_STORE))
endif() endif()
if(MSVC) if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /fp:fast) target_compile_options(${PROJECT_NAME} PRIVATE /fp:fast "$<$<NOT:$<CONFIG:DEBUG>>:/guard:cf>")
if(BUILD_TOOLS AND (NOT WINDOWS_STORE)) if(BUILD_TOOLS AND (NOT WINDOWS_STORE))
target_compile_options(xwbtool PRIVATE /fp:fast) target_compile_options(xwbtool PRIVATE /fp:fast "$<$<NOT:$<CONFIG:DEBUG>>:/guard:cf>")
endif() endif()
if((${CMAKE_SIZEOF_VOID_P} EQUAL 4) AND (NOT ${DIRECTX_ARCH} MATCHES "arm")) if((${CMAKE_SIZEOF_VOID_P} EQUAL 4) AND (NOT ${DIRECTX_ARCH} MATCHES "arm"))
target_compile_options(${PROJECT_NAME} PRIVATE /arch:SSE2) target_compile_options(${PROJECT_NAME} PRIVATE /arch:SSE2)
target_link_options(${PROJECT_NAME} PRIVATE /SAFESEH)
if(BUILD_TOOLS AND (NOT WINDOWS_STORE)) if(BUILD_TOOLS AND (NOT WINDOWS_STORE))
target_compile_options(xwbtool PRIVATE /arch:SSE2) target_compile_options(xwbtool PRIVATE /arch:SSE2)
target_link_options(xwbtool PRIVATE /SAFESEH)
endif() endif()
endif() endif()
endif() endif()
@ -295,9 +307,9 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
endif() endif()
endif() endif()
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options(${PROJECT_NAME} PRIVATE /permissive- /JMC- /Zc:__cplusplus) target_compile_options(${PROJECT_NAME} PRIVATE /sdl /permissive- /JMC- /Zc:__cplusplus)
if(BUILD_TOOLS AND (NOT WINDOWS_STORE)) if(BUILD_TOOLS AND (NOT WINDOWS_STORE))
target_compile_options(xwbtool PRIVATE /permissive- /Zc:__cplusplus) target_compile_options(xwbtool PRIVATE /sdl /permissive- /Zc:__cplusplus)
endif() endif()
if(ENABLE_CODE_ANALYSIS) if(ENABLE_CODE_ANALYSIS)