forked from openscad/openscad
-
Notifications
You must be signed in to change notification settings - Fork 1
/
c++11.pri
50 lines (46 loc) · 1.35 KB
/
c++11.pri
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
macx {
# Mac needs special care to link against the correct C++ library
# We attempt to auto-detect it by inspecting Boost
dirs = $${BOOSTDIR} $${QMAKE_LIBDIR}
for(dir, dirs) {
system(grep -q __112basic_string $${dir}/libboost_thread* >& /dev/null) {
message("Using libc++11")
CONFIG += libc++
}
else {
message("Using libstdc++")
CONFIG += libstdc++
c++11 {
# libc++ is a requirement for using C++11
warning("Disabling C++11 since libstdc++ dependencies were found")
CONFIG -= c++11
}
}
}
libc++ {
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++
QMAKE_OBJECTIVE_CFLAGS += -stdlib=libc++
}
}
c++11 {
# -std=c++11 is only available in gcc>=4.7
*g++*: QMAKE_CXXFLAGS += -std=c++0x
else: QMAKE_CXXFLAGS += -std=c++11
message("Using C++11")
*clang*: {
# 3rd party libraries will probably violate this for a long time
CXX11_SUPPRESS_WARNINGS += -Wno-inconsistent-missing-override
# boost/algorithm/string.hpp does this
CXX11_SUPPRESS_WARNINGS += -Wno-unused-local-typedef
# CGAL
CXX11_SUPPRESS_WARNINGS += -Wno-deprecated-register
QMAKE_CXXFLAGS_WARN_ON += $$CXX11_SUPPRESS_WARNINGS
QMAKE_OBJECTIVE_CFLAGS_WARN_ON += $$CXX11_SUPPRESS_WARNINGS
}
}
else {
*clang* {
QMAKE_CXXFLAGS_WARN_ON += -Wno-c++11-extensions
}
}