diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2018-06-27 00:40:03 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2018-06-27 00:40:03 +0300 |
commit | a190407e9164f07bdb354facc00a4a6dea9d6008 (patch) | |
tree | ef55f97c7792a530b0abbd379c2e6426fba9f5fb /build_files/cmake | |
parent | 11367d968c7967fd696ddda50da3f87005393d8a (diff) | |
parent | 6af06e3c9107f89257e5adac7ec9ffeaa2791eb6 (diff) |
Merge branch 'hair_guides' into hair_guides_grooming
Diffstat (limited to 'build_files/cmake')
-rw-r--r-- | build_files/cmake/macros.cmake | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index d60a6b9b7d7..629d1690e83 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1055,13 +1055,19 @@ macro(remove_cc_flag endmacro() -macro(add_cc_flag +macro(add_c_flag flag) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") endmacro() +macro(add_cxx_flag + flag) + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") +endmacro() + macro(remove_strict_flags) if(CMAKE_COMPILER_IS_GNUCC) @@ -1084,7 +1090,8 @@ macro(remove_strict_flags) ) # negate flags implied by '-Wall' - add_cc_flag("${CC_REMOVE_STRICT_FLAGS}") + add_c_flag("${C_REMOVE_STRICT_FLAGS}") + add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}") endif() if(CMAKE_C_COMPILER_ID MATCHES "Clang") @@ -1096,7 +1103,8 @@ macro(remove_strict_flags) ) # negate flags implied by '-Wall' - add_cc_flag("${CC_REMOVE_STRICT_FLAGS}") + add_c_flag("${C_REMOVE_STRICT_FLAGS}") + add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}") endif() if(MSVC) @@ -1126,28 +1134,39 @@ endmacro() # note, we can only append flags on a single file so we need to negate the options. # at the moment we cant shut up ffmpeg deprecations, so use this, but will # probably add more removals here. -macro(remove_strict_flags_file +macro(remove_strict_c_flags_file filenames) - foreach(_SOURCE ${ARGV}) - if(CMAKE_COMPILER_IS_GNUCC OR - (CMAKE_C_COMPILER_ID MATCHES "Clang")) - + (CMAKE_C_COMPILER_ID MATCHES "Clang")) set_source_files_properties(${_SOURCE} PROPERTIES - COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}" + COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}" ) endif() - if(MSVC) # TODO endif() - endforeach() - unset(_SOURCE) +endmacro() +macro(remove_strict_cxx_flags_file + filenames) + remove_strict_c_flags_file(${filenames} ${ARHV}) + foreach(_SOURCE ${ARGV}) + if(CMAKE_COMPILER_IS_GNUCC OR + (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + set_source_files_properties(${_SOURCE} + PROPERTIES + COMPILE_FLAGS "${CXX_REMOVE_STRICT_FLAGS}" + ) + endif() + if(MSVC) + # TODO + endif() + endforeach() + unset(_SOURCE) endmacro() # External libs may need 'signed char' to be default. |