[Bf-blender-cvs] [6cd0484de8c] master: CMake: Make language explicit for per-file strict flags removal

Sergey Sharybin noreply at git.blender.org
Fri Jun 22 14:40:34 CEST 2018


Commit: 6cd0484de8c765e5ce0f2072c7b10af0794ce7f8
Author: Sergey Sharybin
Date:   Fri Jun 22 14:40:00 2018 +0200
Branches: master
https://developer.blender.org/rB6cd0484de8c765e5ce0f2072c7b10af0794ce7f8

CMake: Make language explicit for per-file strict flags removal

===================================================================

M	build_files/cmake/macros.cmake
M	intern/audaspace/CMakeLists.txt
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/imbuf/CMakeLists.txt
M	source/gameengine/VideoTexture/CMakeLists.txt

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index b487eb4f61b..d265b8ffad2 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -1120,28 +1120,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 "${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.
diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt
index e3c1e81dc06..93dd4d6ac10 100644
--- a/intern/audaspace/CMakeLists.txt
+++ b/intern/audaspace/CMakeLists.txt
@@ -243,7 +243,7 @@ if(WITH_CODEC_FFMPEG)
 		ffmpeg/AUD_FFMPEGWriter.h
 	)
 
-	remove_strict_flags_file(
+	remove_strict_cxx_flags_file(
 		ffmpeg/AUD_FFMPEGFactory.cpp
 		ffmpeg/AUD_FFMPEGReader.cpp
 		ffmpeg/AUD_FFMPEGWriter.cpp
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index c2b2fc4f869..45f2ac083dd 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -409,7 +409,7 @@ if(WITH_CODEC_FFMPEG)
 	)
 	add_definitions(-DWITH_FFMPEG)
 
-	remove_strict_flags_file(
+	remove_strict_c_flags_file(
 		intern/writeffmpeg.c
 	)
 endif()
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt
index 44ff53cc020..8d932c5e79d 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -139,7 +139,7 @@ if(WITH_CODEC_FFMPEG)
 	)
 	add_definitions(-DWITH_FFMPEG)
 
-	remove_strict_flags_file(
+	remove_strict_c_flags_file(
 		intern/indexer.c
 		intern/util.c
 		intern/anim_movie.c
diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt
index 1eb09b02e05..50e25c456e5 100644
--- a/source/gameengine/VideoTexture/CMakeLists.txt
+++ b/source/gameengine/VideoTexture/CMakeLists.txt
@@ -105,7 +105,7 @@ if(WITH_CODEC_FFMPEG)
 	)
 	add_definitions(-DWITH_FFMPEG)
 
-	remove_strict_flags_file(
+	remove_strict_cxx_flags_file(
 		VideoFFmpeg.cpp
 		VideoDeckLink
 		DeckLink



More information about the Bf-blender-cvs mailing list