Author: mordante
Date: Fri Oct 21 20:59:42 2011
New Revision: 51569

URL: http://svn.gna.org/viewcvs/wesnoth?rev=51569&view=rev
Log:
Force -Wold-style-cast off for certain targets.

This allows people to compile Wesnoth with the flag enabled and still
using strict compilation.

Modified:
    trunk/src/CMakeLists.txt

Modified: trunk/src/CMakeLists.txt
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/CMakeLists.txt?rev=51569&r1=51568&r2=51569&view=diff
==============================================================================
--- trunk/src/CMakeLists.txt (original)
+++ trunk/src/CMakeLists.txt Fri Oct 21 20:59:42 2011
@@ -281,6 +281,24 @@
 # a 'lib' is automatically set in front when creating the library (as in the 
filename)
 # internal reference is the name given here
 add_library(wesnoth-lua STATIC EXCLUDE_FROM_ALL ${libwesnoth-lua_STAT_SRC})
+
+
+########### Old style cast flags ###############
+
+# Disable the setting of -Wold-style-cast on some targets.
+# old style casts are not wanted by our coding style but some C based code
+# uses it. Force the flag off for these files. (We don't enable it in our
+# generic compiler flags, but allows people to do it.)
+if(CMAKE_COMPILER_IS_GNUCXX)
+       set_target_properties(wesnoth-lua PROPERTIES COMPILE_FLAGS 
"-Wno-old-style-cast")
+       set_source_files_properties(
+               clipboard.cpp
+               network.cpp
+               network_worker.cpp
+               text.cpp
+               PROPERTIES
+                       COMPILE_FLAGS "-Wno-old-style-cast")
+endif(CMAKE_COMPILER_IS_GNUCXX)
 
 
 ########### Wesnoth main source files ###############


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to