summaryrefslogtreecommitdiffstats
path: root/ipc/chromium/src/third_party/libevent/cmake/AddCompilerFlags.cmake
blob: 9dc21d03adc51a5fb9aefe3099bbdf2d5939ae66 (plain)
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()