Author: jgardou
Date: Mon Jul 30 00:00:51 2012
New Revision: 56990
URL:
http://svn.reactos.org/svn/reactos?rev=56990&view=rev
Log:
[CMAKE]
- Add macro to add flags to a specific language.
Modified:
trunk/reactos/cmake/compilerflags.cmake
Modified: trunk/reactos/cmake/compilerflags.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/compilerflags.cmake?…
==============================================================================
--- trunk/reactos/cmake/compilerflags.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/compilerflags.cmake [iso-8859-1] Mon Jul 30 00:00:51 2012
@@ -36,6 +36,7 @@
# add_target_compile_flags(mymodule "-pedantic -O5")
# add_target_compile_definitions(mymodule WIN32 _WIN32 INLINE=inline)
# add_target_include_directories(mymodule include ../include)
+# add_compile_flags_language("-std=gnu99" "C")
function(add_compile_flags _flags)
if(${ARGC} GREATER 1)
message(STATUS "Excess arguments to add_compile_flags! Args ${ARGN}")
@@ -44,6 +45,14 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${_flags}" PARENT_SCOPE)
+endfunction()
+
+function(add_compile_flags_language _flags _lang)
+ if(NOT ${ARGC} EQUAL 2)
+ message(STATUS "Wrong arguments to add_compile_flags_language! Args
${ARGN}")
+ endif()
+ # Adds the compiler flag to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
+ set(CMAKE_${_lang}_FLAGS "${CMAKE_${_lang}_FLAGS} ${_flags}" PARENT_SCOPE)
endfunction()
function(add_target_compile_flags _module _flags)