File: AddCompilerFlags.cmake

package info (click to toggle)
libevent 2.1.12-stable-10
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 5,304 kB
  • sloc: ansic: 56,580; sh: 4,525; python: 1,356; makefile: 217
file content (13 lines) | stat: -rw-r--r-- 336 bytes parent folder | download | duplicates (34)
1
2
3
4
5
6
7
8
9
10
11
12
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()