diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-22 15:42:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-22 15:42:25 +0300 |
commit | f4d6e66b25d154736f3e312de2df39702053f94a (patch) | |
tree | 7a9ea966e5099fea4c763d068118a977a31ca5e6 /build_files | |
parent | 6528310543e347ed0c178872fb89692468a2c9b2 (diff) | |
parent | 6cd0484de8c765e5ce0f2072c7b10af0794ce7f8 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/macros.cmake | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 8cf90d0d22c..d6fde945173 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1054,13 +1054,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) @@ -1083,7 +1089,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") @@ -1095,7 +1102,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) @@ -1125,28 +1133,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")) - 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_C_COMPILER_ID MATCHES "Clang")) + set_source_files_properties(${_SOURCE} + PROPERTIES + COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}" + ) + endif() + if(MSVC) + # TODO + endif() + endforeach() + unset(_SOURCE) endmacro() # External libs may need 'signed char' to be default. |