]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Some tweaks to the cmake scripts
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 23 Oct 2022 20:46:39 +0000 (21:46 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 23 Oct 2022 20:46:39 +0000 (21:46 +0100)
CMakeLists.txt
cmake/CompilerWarnings.cmake

index 571a09166990c219148ceb66cab3785b3efc80bd..835f56039968e09965a40365d291600ecd95caee 100644 (file)
@@ -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>
index fe6735c354dd58f077bd1209e41ab0bbe6ca331e..629bb6ee1d80437cb61433a06eeb93052b15dd0a 100644 (file)
@@ -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()