mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-14 20:37:06 +00:00
b4d6d81dd1
Merge commit '5223d1d95fddcef6f9a36e264a5800bd907ade8b' into main
(cherry picked from commit b50261e21f
)
14 lines
336 B
CMake
14 lines
336 B
CMake
include(CheckCCompilerFlag)
|
|
|
|
macro(add_compiler_flags)
|
|
foreach(flag ${ARGN})
|
|
string(REGEX REPLACE "[-.+/:= ]" "_" _flag_esc "${flag}")
|
|
|
|
check_c_compiler_flag("${flag}" check_c_compiler_flag_${_flag_esc})
|
|
|
|
if (check_c_compiler_flag_${_flag_esc})
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
|
endif()
|
|
endforeach()
|
|
endmacro()
|