slsDetectorPackage/cmake/SlsAddFlag.cmake
2021-10-11 19:56:39 +02:00

10 lines
344 B
CMake

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()