Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r--build_files/cmake/macros.cmake43
1 files changed, 31 insertions, 12 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 8cf90d0d22c..ce2241a775d 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"))
-
+ (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.