@@ -45,6 +45,7 @@ if(MSVC)
45
45
46
46
if ((MSVC_VERSION GREATER_EQUAL 1928)
47
47
AND (CMAKE_SIZEOF_VOID_P EQUAL 8)
48
+ AND (NOT (TARGET OpenEXR::OpenEXR))
48
49
AND ((NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM" )) OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)))
49
50
list (APPEND COMPILER_SWITCHES "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>" )
50
51
list (APPEND LINKER_SWITCHES "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>" )
@@ -80,12 +81,12 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
80
81
81
82
if (CMAKE_INTERPROCEDURAL_OPTIMIZATION)
82
83
message (STATUS "Building using Whole Program Optimization" )
83
- list (APPEND /Gy /Gw)
84
+ list (APPEND COMPILER_SWITCHES /Gy /Gw)
84
85
endif ()
85
86
86
87
if (OpenMP_CXX_FOUND)
87
88
# OpenMP in MSVC is not compatible with /permissive- unless you disable two-phase lookup
88
- list (APPEND /Zc:twoPhase-)
89
+ list (APPEND COMPILER_SWITCHES /Zc:twoPhase-)
89
90
endif ()
90
91
91
92
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
@@ -94,9 +95,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
94
95
95
96
if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
96
97
AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango" )))
97
- foreach (t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME} )
98
- target_compile_options (${t} PRIVATE /Zc:preprocessor /wd5104 /wd5105)
99
- endforeach ()
98
+ list (APPEND COMPILER_SWITCHES /Zc:preprocessor /wd5104 /wd5105)
100
99
endif ()
101
100
102
101
if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm" )))
@@ -109,10 +108,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
109
108
110
109
if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.31)
111
110
AND (XBOX_CONSOLE_TARGET STREQUAL "durango" ))
112
-
113
- foreach (t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME} )
114
- target_compile_options (${t} PRIVATE /Zc:static_assert-)
115
- endforeach ()
111
+ list (APPEND COMPILER_SWITCHES /Zc:static_assert-)
116
112
endif ()
117
113
118
114
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
0 commit comments