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:
authorCampbell Barton <ideasman42@gmail.com>2011-10-27 11:26:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-27 11:26:41 +0400
commitc936c61bace7892950c33f7aa93a92fc719dfca9 (patch)
tree080ce035a69c00f7be449d79ea29cab159cb1e68
parent6aaccb69cc763e6a7742f0ca9ef7daa798072f04 (diff)
tweak remove_strict_flags so it can be used with gcc's -Wall
-rw-r--r--build_files/cmake/macros.cmake27
-rw-r--r--intern/opennl/CMakeLists.txt2
2 files changed, 20 insertions, 9 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index bf90ef85eb0..8e5d914948b 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -377,7 +377,7 @@ endmacro()
# needs to be removed for some external libs which we dont maintain.
# utility macro
-macro(remove_flag
+macro(remove_cc_flag
flag)
string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
@@ -394,16 +394,27 @@ macro(remove_flag
endmacro()
+macro(add_cc_flag
+ flag)
+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+endmacro()
+
macro(remove_strict_flags)
if(CMAKE_COMPILER_IS_GNUCC)
- remove_flag("-Wstrict-prototypes")
- remove_flag("-Wunused-parameter")
- remove_flag("-Wwrite-strings")
- remove_flag("-Wundef")
- remove_flag("-Wshadow")
- remove_flag("-Werror=[^ ]+")
- remove_flag("-Werror")
+ remove_cc_flag("-Wstrict-prototypes")
+ remove_cc_flag("-Wunused-parameter")
+ remove_cc_flag("-Wwrite-strings")
+ remove_cc_flag("-Wundef")
+ remove_cc_flag("-Wshadow")
+ remove_cc_flag("-Werror=[^ ]+")
+ remove_cc_flag("-Werror")
+
+ # negate flags implied by '-Wall'
+ add_cc_flag("-Wno-unused-parameter")
+ add_cc_flag("-Wno-unused-but-set-variable")
endif()
if(MSVC)
diff --git a/intern/opennl/CMakeLists.txt b/intern/opennl/CMakeLists.txt
index f146a96928e..231802b31f2 100644
--- a/intern/opennl/CMakeLists.txt
+++ b/intern/opennl/CMakeLists.txt
@@ -28,7 +28,7 @@ remove_strict_flags()
# remove debug flag here since this is not a blender maintained library
# and debug gives a lot of prints on UV unwrapping. developers can enable if they need to.
-remove_flag("-DDEBUG")
+remove_cc_flag("-DDEBUG")
# quiet compiler warnings about undefined defines