1fc740178218341323296e9141b6fd1b26a97db2
[reactos.git] / reactos / cmake / compilerflags.cmake
1
2 function(add_compiler_flags)
3 set(flags_list "")
4 # Adds the compiler flag to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
5 foreach(flag ${ARGN})
6 set(flags_list "${flags_list} ${flag}")
7 endforeach()
8
9 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flags_list}" PARENT_SCOPE)
10 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flags_list}" PARENT_SCOPE)
11 endfunction()
12
13 function(add_linkerflag MODULE _flag)
14 set(NEW_LINKER_FLAGS ${_flag})
15 get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
16 if(LINKER_FLAGS)
17 set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")
18 endif()
19 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS})
20 endfunction()
21
22 macro(set_unicode)
23 add_definitions(-DUNICODE -D_UNICODE)
24 set(IS_UNICODE 1)
25 endmacro()