[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41276] trunk/blender: cmake macro to set less strict flags per file - remove_strict_flags_file( file, file...)

Campbell Barton ideasman42 at gmail.com
Tue Oct 25 13:06:54 CEST 2011


Revision: 41276
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41276
Author:   campbellbarton
Date:     2011-10-25 11:06:52 +0000 (Tue, 25 Oct 2011)
Log Message:
-----------
cmake macro to set less strict flags per file - remove_strict_flags_file(file, file...)

this way we can avoid removing strict flags for all files in blenkernel.

Modified Paths:
--------------
    trunk/blender/build_files/cmake/macros.cmake
    trunk/blender/intern/ffmpeg/ffmpeg_compat.h
    trunk/blender/source/blender/blenkernel/CMakeLists.txt
    trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c
    trunk/blender/source/blender/imbuf/CMakeLists.txt

Modified: trunk/blender/build_files/cmake/macros.cmake
===================================================================
--- trunk/blender/build_files/cmake/macros.cmake	2011-10-25 07:42:40 UTC (rev 41275)
+++ trunk/blender/build_files/cmake/macros.cmake	2011-10-25 11:06:52 UTC (rev 41276)
@@ -16,7 +16,7 @@
 	unset(_file_name_EXT)
 endmacro()
 
-# usefil for adding debug suffix to library lists:
+# useful for adding debug suffix to library lists:
 # /somepath/foo.lib --> /somepath/foo_d.lib
 macro(file_list_suffix
 	fp_list_new fp_list fn_suffix
@@ -412,6 +412,32 @@
 
 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
+	filenames)
+
+	foreach(_SOURCE ${ARGV})
+
+		if(CMAKE_COMPILER_IS_GNUCC)
+			set_source_files_properties(${_SOURCE}
+				PROPERTIES
+					COMPILE_FLAGS "-Wno-deprecated-declarations"
+			)
+		endif()
+
+		if(MSVC)
+			# TODO
+		endif()
+
+	endforeach()	
+
+	unset(_SOURCE)
+
+endmacro()
+
+
 macro(ADD_CHECK_C_COMPILER_FLAG
 	_CFLAGS
 	_CACHE_VAR

Modified: trunk/blender/intern/ffmpeg/ffmpeg_compat.h
===================================================================
--- trunk/blender/intern/ffmpeg/ffmpeg_compat.h	2011-10-25 07:42:40 UTC (rev 41275)
+++ trunk/blender/intern/ffmpeg/ffmpeg_compat.h	2011-10-25 11:06:52 UTC (rev 41276)
@@ -150,7 +150,8 @@
 	if (pts == AV_NOPTS_VALUE) {
 		pts = 0;
 	}
-	
+
+	(void)avctx;
 	return pts;
 }
 

Modified: trunk/blender/source/blender/blenkernel/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/blenkernel/CMakeLists.txt	2011-10-25 07:42:40 UTC (rev 41275)
+++ trunk/blender/source/blender/blenkernel/CMakeLists.txt	2011-10-25 11:06:52 UTC (rev 41276)
@@ -23,11 +23,6 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-if(WITH_CODEC_FFMPEG)
-	# FFMPEG gives warnigns which are hard to avoid across multiple versions.
-	remove_strict_flags()
-endif()
-
 set(INC 
 	.
 	../avi
@@ -304,6 +299,10 @@
 		${FFMPEG_INCLUDE_DIRS}
 	)
 	add_definitions(-DWITH_FFMPEG)
+
+	remove_strict_flags_file(
+		intern/writeffmpeg.c
+	)
 endif()
 
 if(WITH_PYTHON)

Modified: trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c	2011-10-25 07:42:40 UTC (rev 41275)
+++ trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c	2011-10-25 11:06:52 UTC (rev 41276)
@@ -1102,7 +1102,7 @@
 		idp_type = IDP_FLOAT;
 		break;
 	case FF_OPT_TYPE_STRING:
-		val.str = "                                                                               ";
+		val.str = (char *)"                                                                               ";
 		idp_type = IDP_STRING;
 		break;
 	case FF_OPT_TYPE_CONST:
@@ -1377,4 +1377,3 @@
 }
 
 #endif
-

Modified: trunk/blender/source/blender/imbuf/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/imbuf/CMakeLists.txt	2011-10-25 07:42:40 UTC (rev 41275)
+++ trunk/blender/source/blender/imbuf/CMakeLists.txt	2011-10-25 11:06:52 UTC (rev 41276)
@@ -23,11 +23,6 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-if(WITH_CODEC_FFMPEG)
-	# FFMPEG gives warnigns which are hard to avoid across multiple versions.
-	remove_strict_flags()
-endif()
-
 set(INC 
 	.
 	../avi
@@ -160,6 +155,12 @@
 		${FFMPEG_INCLUDE_DIRS}
 	)
 	add_definitions(-DWITH_FFMPEG)
+
+	remove_strict_flags_file(
+		intern/indexer.c
+		intern/util.c
+		intern/anim_movie.c
+	)
 endif()
 
 if(WITH_IMAGE_DDS)




More information about the Bf-blender-cvs mailing list