Skip to content

Commit

Permalink
More cmake udpate
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Aug 17, 2024
1 parent 4bc3570 commit 377f45c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions build/CompilerAndLinker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,32 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
list(APPEND COMPILER_SWITCHES /Zc:__cplusplus /Zc:inline /fp:fast /Qdiag-disable:161)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
list(APPEND COMPILER_SWITCHES /sdl /permissive- /JMC- /Zc:__cplusplus /Zc:inline /fp:fast)
list(APPEND COMPILER_SWITCHES /sdl /Zc:inline /fp:fast)

if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
message(STATUS "Building using Whole Program Optimization")
list(APPEND COMPILER_SWITCHES $<$<NOT:$<CONFIG:Debug>>:/Gy /Gw>)
endif()

if(OpenMP_CXX_FOUND
OR (XBOX_CONSOLE_TARGET STREQUAL "durango"))
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.10)
list(APPEND COMPILER_SWITCHES /permissive-)
endif()

if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.11)
AND (OpenMP_CXX_FOUND
OR (XBOX_CONSOLE_TARGET STREQUAL "durango")))
# OpenMP in MSVC is not compatible with /permissive- unless you disable two-phase lookup
list(APPEND COMPILER_SWITCHES /Zc:twoPhase-)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.14)
list(APPEND COMPILER_SWITCHES /Zc:__cplusplus)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.15)
list(APPEND COMPILER_SWITCHES /JMC-)
endif()

if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.20)
AND (XBOX_CONSOLE_TARGET STREQUAL "durango"))
list(APPEND COMPILER_SWITCHES /d2FH4-)
Expand Down

0 comments on commit 377f45c

Please sign in to comment.