Skip to content

Commit

Permalink
[Minor] Some tweaks to the cmake scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Oct 23, 2022
1 parent 96b9470 commit 575aa94
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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>
Expand Down
10 changes: 6 additions & 4 deletions cmake/CompilerWarnings.cmake
Expand Up @@ -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")
Expand Down Expand Up @@ -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()

0 comments on commit 575aa94

Please sign in to comment.