File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,14 @@ CMAKE_DEPENDENT_OPTION(ENABLE_HLSL
106
106
option (ENABLE_RTTI "Enables RTTI" OFF )
107
107
option (ENABLE_EXCEPTIONS "Enables Exceptions" OFF )
108
108
option (ENABLE_OPT "Enables spirv-opt capability if present" ON )
109
- option (ENABLE_PCH "Enables Precompiled header" ON )
109
+
110
+ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" )
111
+ # Workaround for CMake behavior on Mac OS with gcc, cmake generates -Xarch_* arguments
112
+ # which gcc rejects
113
+ option (ENABLE_PCH "Enables Precompiled header" OFF )
114
+ else ()
115
+ option (ENABLE_PCH "Enables Precompiled header" ON )
116
+ endif ()
110
117
option (ENABLE_CTEST "Enables testing" ON )
111
118
112
119
if (ENABLE_GLSLANG_INSTALL AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32 )
@@ -163,7 +170,7 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
163
170
add_compile_options (-Werror=deprecated-copy )
164
171
endif ()
165
172
166
- if (NOT CMAKE_VERSION VERSION_LESS "3.13" )
173
+ if (NOT CMAKE_VERSION VERSION_LESS "3.13" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
167
174
# Error if there's symbols that are not found at link time.
168
175
# add_link_options() was added in CMake 3.13 - if using an earlier
169
176
# version don't set this - it should be caught by presubmits anyway.
You can’t perform that action at this time.
0 commit comments