CMake code review (#123)
This commit is contained in:
Родитель
631d41dccb
Коммит
f763b4b381
|
@ -264,7 +264,7 @@ if(MSVC)
|
|||
target_link_options(${t} PRIVATE /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO)
|
||||
endforeach()
|
||||
|
||||
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")))
|
||||
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
|
||||
target_link_options(${t} PRIVATE /SAFESEH)
|
||||
endforeach()
|
||||
|
@ -305,7 +305,7 @@ if(XBOX_CONSOLE_TARGET STREQUAL "scarlett")
|
|||
target_compile_options(${PROJECT_NAME} PRIVATE $<IF:$<CXX_COMPILER_ID:MSVC>,/favor:AMD64 /arch:AVX2,-march=znver2>)
|
||||
elseif(XBOX_CONSOLE_TARGET STREQUAL "xboxone")
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE $<IF:$<CXX_COMPILER_ID:MSVC>,/favor:AMD64 /arch:AVX,-march=btver2>)
|
||||
elseif(NOT ${DIRECTX_ARCH} MATCHES "^arm")
|
||||
elseif(NOT (${DIRECTX_ARCH} MATCHES "^arm"))
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
set(ARCH_SSE2 $<$<CXX_COMPILER_ID:MSVC>:/arch:SSE2> $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
|
||||
else()
|
||||
|
@ -376,8 +376,14 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
|||
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
|
||||
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
|
||||
target_compile_options(${t} PRIVATE /Zc:checkGwOdr $<$<VERSION_GREATER_EQUAL:${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION},10.0.22000>:/Zc:templateScope>)
|
||||
target_compile_options(${t} PRIVATE /Zc:checkGwOdr)
|
||||
endforeach()
|
||||
|
||||
if(NOT (DEFINED XBOX_CONSOLE_TARGET))
|
||||
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
|
||||
target_compile_options(${t} PRIVATE $<$<VERSION_GREATER_EQUAL:${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION},10.0.22000>:/Zc:templateScope>)
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(WarningsEXE "/wd4061" "/wd4365" "/wd4514" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4711" "/wd4751" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd5219")
|
||||
|
@ -415,16 +421,17 @@ if(BUILD_TOOLS AND WIN32)
|
|||
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT meshconvert)
|
||||
endif()
|
||||
|
||||
if(BUILD_TOOLS AND WIN32 AND (NOT VCPKG_TOOLCHAIN))
|
||||
if(BUILD_TOOLS AND (NOT VCPKG_TOOLCHAIN))
|
||||
foreach(t IN LISTS TOOL_EXES)
|
||||
install(TARGETS ${t} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#--- Test suite
|
||||
include(CTest)
|
||||
if(BUILD_TESTING AND WIN32 AND (NOT WINDOWS_STORE) AND (NOT (DEFINED XBOX_CONSOLE_TARGET))
|
||||
AND (EXISTS "${CMAKE_CURRENT_LIST_DIR}/Tests/CMakeLists.txt"))
|
||||
enable_testing()
|
||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/Tests)
|
||||
if(WIN32 AND (NOT WINDOWS_STORE) AND (NOT (DEFINED XBOX_CONSOLE_TARGET)))
|
||||
include(CTest)
|
||||
if(BUILD_TESTING AND (EXISTS "${CMAKE_CURRENT_LIST_DIR}/Tests/CMakeLists.txt"))
|
||||
enable_testing()
|
||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/Tests)
|
||||
endif()
|
||||
endif()
|
||||
|
|
Загрузка…
Ссылка в новой задаче