aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-10-23 21:46:39 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-10-23 21:46:39 +0100
commit575aa943606aa2f946f407c663259d70d4a87ffb (patch)
tree976612ec5c0e1ed28083409cef4a951135a2dd04
parent96b94707c1c6fde1cc2aa06522587114c5c6c809 (diff)
downloadrspamd-575aa943606aa2f946f407c663259d70d4a87ffb.tar.gz
rspamd-575aa943606aa2f946f407c663259d70d4a87ffb.zip
[Minor] Some tweaks to the cmake scripts
-rw-r--r--CMakeLists.txt5
-rw-r--r--cmake/CompilerWarnings.cmake10
2 files changed, 11 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 571a09166..835f56039 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -402,6 +402,11 @@ ELSE(HAVE_PCRE_JIT_FAST)
ENDIF(HAVE_PCRE_JIT_FAST)
ENDIF()
+CHECK_C_COMPILER_FLAG(-fPIC SUPPORT_FPIC)
+IF(SUPPORT_FPIC)
+ ADD_COMPILE_OPTIONS("-fPIC")
+ENDIF(SUPPORT_FPIC)
+
FILE(WRITE ${CMAKE_BINARY_DIR}/pthread_setpshared.c "
#include <pthread.h>
#include <stdlib.h>
diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake
index fe6735c35..629bb6ee1 100644
--- a/cmake/CompilerWarnings.cmake
+++ b/cmake/CompilerWarnings.cmake
@@ -17,6 +17,9 @@ CHECK_C_COMPILER_FLAG(-Wnull-dereference SUPPORT_WNULL_DEREFERENCE)
CHECK_C_COMPILER_FLAG(-Wduplicated-cond SUPPORT_WDUPLICATED_COND)
# GCC 7 specific
CHECK_C_COMPILER_FLAG(-Wimplicit-fallthrough SUPPORT_WIMPLICIT_FALLTHROUGH)
+# Special check for deprecated declarations, as since OpenSSL 3.0 they
+# just poison output for no good reason
+CHECK_C_COMPILER_FLAG(-Wdeprecated-declarations SUPPORT_WDEPRECATED_DECLARATIONS)
IF(SUPPORT_WEXTRA)
ADD_COMPILE_OPTIONS("-Wextra")
@@ -76,7 +79,6 @@ IF(SUPPORT_WMISSING_FORMAT_ATTRIBUTE)
ADD_COMPILE_OPTIONS("-Wmissing-format-attribute")
ENDIF(SUPPORT_WMISSING_FORMAT_ATTRIBUTE)
-CHECK_C_COMPILER_FLAG(-fPIC SUPPORT_FPIC)
-IF(SUPPORT_FPIC)
- ADD_COMPILE_OPTIONS("-fPIC")
-ENDIF(SUPPORT_FPIC)
+IF(SUPPORT_WDEPRECATED_DECLARATIONS)
+ ADD_COMPILE_OPTIONS("-Wno-deprecated-declarations")
+ENDIF()