blob: c1da7f7136d1530db8ab367c2ec6882db13f28a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
From: Julian Ospald <hasufell@gentoo.org>
Date: Wed Jun 27 22:04:32 UTC 2012
Subject: build system
respect flags
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -365,21 +365,6 @@
endif()
- # Warning level
- add_cxxflag("-Wall")
- add_cxxflag("-Wextra")
- add_cxxflag("-Wformat=2")
- add_cxxflag("-Wundef")
- add_cxxflag("-Wpointer-arith")
- add_cxxflag("-Wcast-qual")
- add_cxxflag("-Woverloaded-virtual")
- add_cxxflag("-Wlogical-op")
-
- add_cxxflag("-Wliteral-conversion")
- add_cxxflag("-Wshift-overflow")
- add_cxxflag("-Woverflow")
- add_cxxflag("-Wbool-conversions")
-
# TODO enable:
# add_cxxflag("-Wconversion") # very noisy
# add_cxxflag("-Wsign-conversion") # very noisy
@@ -391,27 +376,12 @@
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-
- #Debug
add_definitions(-D_DEBUG)
-
- check_compiler_flag(RESULT "-g3")
- if(NOT RESULT STREQUAL "")
- string(REGEX REPLACE "-g(|[0-9]|gdb)" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RESULT}")
- endif()
-
- check_compiler_flag(RESULT "-O0")
- string(REGEX REPLACE "-O[0-9]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RESULT}")
-
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
-
if((NOT CMAKE_CXX_FLAGS MATCHES "-g(|[0-9]|gdb)")
AND (NOT CMAKE_CXX_FLAGS_RELEASE MATCHES "-g(|[0-9]|gdb)"))
add_cxxflag("-g2")
endif()
-
endif()
if(DEBUG_EXTRA)
@@ -419,15 +389,7 @@
add_cxxflag("-fbounds-checking")
add_cxxflag("-fcatch-undefined-behavior")
add_cxxflag("-Wstrict-aliasing=1")
- else()
- # -Wuninitialized causes too many false positives
- add_cxxflag("-Wno-uninitialized")
- # (clang only) Conflicts with using const variables for configuration.
- add_cxxflag("-Wno-constant-logical-operand")
endif()
-
- # Because we are lazy
- add_ldflag("-Wl,--as-needed")
# Xcode does not support -isystem yet
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|