File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -190,14 +190,11 @@ target_compile_options(${target}
190190
191191# Fix Ruby MacOSX LLVM bug
192192# '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
193-
194193include (Portability)
195- if ("${PROJECT_OS_FAMILY} " STREQUAL "macos" )
196- if ("${CMAKE_C_COMPILER_ID} " STREQUAL "AppleClang" OR "${CMAKE_C_COMPILER_ID} " STREQUAL "AppleClang*" OR "${CMAKE_C_COMPILER_ID} " STREQUAL "Clang" )
197- target_compile_options (${target} PRIVATE "-fdeclspec" )
198- endif ()
199- endif ()
200194
195+ if ("${PROJECT_OS_FAMILY} " STREQUAL "macos" AND CMAKE_C_COMPILER_ID MATCHES "Clang" )
196+ target_compile_options (${target} PRIVATE "-fdeclspec" )
197+ endif ()
201198
202199#
203200# Linker options
Original file line number Diff line number Diff line change @@ -223,14 +223,11 @@ target_compile_options(${SWIG_MODULE_${target}_REAL_NAME}
223223
224224# Fix Ruby MacOSX LLVM bug
225225# '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
226-
227226include (Portability)
228- if ("${PROJECT_OS_FAMILY} " STREQUAL "macos" )
229- if ("${CMAKE_C_COMPILER_ID} " STREQUAL "AppleClang" OR "${CMAKE_C_COMPILER_ID} " STREQUAL "AppleClang*" OR "${CMAKE_C_COMPILER_ID} " STREQUAL "Clang" )
230- target_compile_options (${target} PRIVATE "-fdeclspec" )
231- endif ()
232- endif ()
233227
228+ if ("${PROJECT_OS_FAMILY} " STREQUAL "macos" AND CMAKE_C_COMPILER_ID MATCHES "Clang" )
229+ target_compile_options (${target} PRIVATE "-fdeclspec" )
230+ endif ()
234231
235232#
236233# Linker options
You can’t perform that action at this time.
0 commit comments