mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-03 16:40:41 +02:00
disable Wstringop-truncation for servers
This commit is contained in:
parent
5e672fcd54
commit
e84f5bec0b
@ -7,6 +7,9 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
include(cmake/project_version.cmake)
|
||||
|
||||
#functions to add compiler flags
|
||||
include(cmake/SlsAddFlag.cmake)
|
||||
|
||||
# Include additional modules that are used unconditionally
|
||||
include(GNUInstallDirs)
|
||||
|
||||
@ -142,6 +145,9 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
sls_add_flag_if_available("-Wno-stringop-truncation" slsProjectCSettings)
|
||||
|
||||
if(SLS_USE_SANITIZER)
|
||||
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
|
||||
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
||||
|
10
cmake/SlsAddFlag.cmake
Normal file
10
cmake/SlsAddFlag.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
include(CheckCXXCompilerFlag)
|
||||
function(sls_add_flag_if_available flag target)
|
||||
check_cxx_compiler_flag(${flag} flag_supported)
|
||||
if(flag_supported)
|
||||
target_compile_options(${target} INTERFACE ${flag})
|
||||
message("Adding: ${flag} to ${target}")
|
||||
else()
|
||||
message("Flag: ${flag} not supported")
|
||||
endif()
|
||||
endfunction()
|
Loading…
x
Reference in New Issue
Block a user