Skip to content

Commit 0ee9bce

Browse files
committed
Fix cmake Ruby compiler flags fix for CI/CD
1 parent 7a16942 commit 0ee9bce

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

source/loaders/rb_loader/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,10 @@ target_compile_options(${target}
192192
# '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
193193

194194
include(Portability)
195-
message("${PROJECT_OS_FAMILY}")
196195
if("${PROJECT_OS_FAMILY}" STREQUAL "macos" )
197-
message("PROJECT FAMILY IS MACOS")
198196
if("${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang*" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
199-
message("${CMAKE_C_COMPILER_ID} inside if clause")
200197
target_compile_options(${target} PRIVATE "-fdeclspec")
201198
endif()
202-
message("After if for Ruby compiler bug fix on MacOSX")
203199
endif()
204200

205201

source/ports/rb_port/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ target_compile_options(${SWIG_MODULE_${target}_REAL_NAME}
221221
INTERFACE
222222
)
223223

224+
# Fix Ruby MacOSX LLVM bug
225+
# '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
226+
227+
include(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()
233+
234+
224235
#
225236
# Linker options
226237
#

0 commit comments

Comments
 (0)