diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:02:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:02:34 +0000 |
commit | fadeddfbb2aa38a980dd959b5ec1ffba7afd43cb (patch) | |
tree | a7bde6111c84ea64619656a38fba50909fa0bf60 /libevent/cmake/AddCompilerFlags.cmake | |
parent | Initial commit. (diff) | |
download | lldpd-fadeddfbb2aa38a980dd959b5ec1ffba7afd43cb.tar.xz lldpd-fadeddfbb2aa38a980dd959b5ec1ffba7afd43cb.zip |
Adding upstream version 1.0.18.upstream/1.0.18upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libevent/cmake/AddCompilerFlags.cmake')
-rw-r--r-- | libevent/cmake/AddCompilerFlags.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libevent/cmake/AddCompilerFlags.cmake b/libevent/cmake/AddCompilerFlags.cmake new file mode 100644 index 0000000..9dc21d0 --- /dev/null +++ b/libevent/cmake/AddCompilerFlags.cmake @@ -0,0 +1,13 @@ +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() |