aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/modules/PaludisCompileFlags.cmake2
-rw-r--r--ruby/CMakeLists.txt6
2 files changed, 8 insertions, 0 deletions
diff --git a/cmake/modules/PaludisCompileFlags.cmake b/cmake/modules/PaludisCompileFlags.cmake
index 7db849f37..2d3dae17f 100644
--- a/cmake/modules/PaludisCompileFlags.cmake
+++ b/cmake/modules/PaludisCompileFlags.cmake
@@ -76,3 +76,5 @@ append_if(CXX_SUPPORTS_FVISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden"
check_cxx_compiler_flag("-Werror -fno-strict-aliasing" CXX_SUPPORTS_FNO_STRICT_ALIASING)
check_cxx_compiler_flag("-Werror -g0" CXX_SUPPORTS_G0)
+check_cxx_compiler_flag("-Werror -fdeclspec" CXX_SUPPORTS_FDECLSPEC)
+
diff --git a/ruby/CMakeLists.txt b/ruby/CMakeLists.txt
index 1bcbed1a1..a200fe50d 100644
--- a/ruby/CMakeLists.txt
+++ b/ruby/CMakeLists.txt
@@ -28,6 +28,9 @@ if(ENABLE_RUBY)
target_include_directories(libpaludisruby SYSTEM
PRIVATE
${RUBY_INCLUDE_DIRS})
+ if(CXX_SUPPORTS_FDECLSPEC)
+ target_compile_options(libpaludisruby PRIVATE -fdeclspec)
+ endif()
target_link_libraries(libpaludisruby
PRIVATE
libpaludis
@@ -40,6 +43,9 @@ if(ENABLE_RUBY)
target_include_directories(Paludis SYSTEM
PRIVATE
${RUBY_INCLUDE_DIRS})
+ if(CXX_SUPPORTS_FDECLSPEC)
+ target_compile_options(Paludis PRIVATE -fdeclspec)
+ endif()
target_link_libraries(Paludis
PRIVATE
libpaludisruby)