diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-02-17 19:52:55 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-02-17 19:52:55 +0000 |
commit | ebb5af4db8596413510b44d04da158515cde352e (patch) | |
tree | 21bfcd89d714f17992a37cd857d62df743b23f26 /cmake/Toolset.cmake | |
parent | bd9708cf5a156cc292263058e8f3cdbaf4ef3a68 (diff) | |
download | rspamd-ebb5af4db8596413510b44d04da158515cde352e.tar.gz rspamd-ebb5af4db8596413510b44d04da158515cde352e.zip |
[Minor] Several fixes for clang-16
Diffstat (limited to 'cmake/Toolset.cmake')
-rw-r--r-- | cmake/Toolset.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/Toolset.cmake b/cmake/Toolset.cmake index ae5a8d020..cd372af13 100644 --- a/cmake/Toolset.cmake +++ b/cmake/Toolset.cmake @@ -10,6 +10,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang|AppleClang") SET (COMPILER_CLANG 1) endif() +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + SET (COMPILER_FAST_MATH "") if (ENABLE_FAST_MATH MATCHES "ON") # We need to keep nans and infinities, so cannot keep all fast math there @@ -41,7 +43,11 @@ elseif (COMPILER_CLANG) if (CMAKE_C_COMPILER_VERSION VERSION_LESS ${CLANG_MINIMUM_VERSION}) message (FATAL_ERROR "Clang version must be at least ${CLANG_MINIMUM_VERSION}.") endif () - ADD_COMPILE_OPTIONS(-Wno-unused-command-line-argument) + # Hack to fix try_compile + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-ignored-optimization-argument") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ignored-optimization-argument") if (ENABLE_LIBCXX MATCHES "ON") # Use libc++ as libstdc++ is buggy in many cases set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") |