summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt_common.prf
blob: 746e2878a701cce83e406038110b854998816308 (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
#
#  W A R N I N G
#  -------------
#
# This file is not part of the Qt API.  It exists purely as an
# implementation detail.  It may change from version to version
# without notice, or even be removed.
#
# We mean it.
#

contains(QT_CONFIG, c++11): CONFIG += c++11
contains(TEMPLATE, .*lib) {
    # module and plugins
    contains(QT_CONFIG, reduce_exports): CONFIG += hide_symbols
    unix:contains(QT_CONFIG, reduce_relocations): CONFIG += bsymbolic_functions
    contains(QT_CONFIG, largefile): CONFIG += largefile
    contains(QT_CONFIG, separate_debug_info): CONFIG += separate_debug_info
    contains(QT_CONFIG, separate_debug_info_nocopy): CONFIG += separate_debug_info_nocopy
}

warnings_are_errors:warning_clean {
    # If the module declares that it has does its clean-up of warnings, enable -Werror.
    # This setting is compiler-dependent anyway because it depends on the version of the
    # compiler.
    clang {
        # Apple clang 4.0-4.2
        # Regular clang is not tested
        ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
        contains(ver, "4\\.[012]") {
            QMAKE_CXXFLAGS += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR
        }
    } else:intel_icc:linux {
        # Intel CC 13.0 - 14.0, on Linux only
        ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION}
        linux:contains(ver, "(13\\.|14\\.0)") {
            # 177: function "entity" was declared but never referenced
            #      (too aggressive; ICC reports even for functions created due to template instantiation)
            # 1224: #warning directive
            # 1478: function "entity" (declared at line N) was declared deprecated
            # 1881: argument must be a constant null pointer value
            #      (NULL in C++ is usually a literal 0)
            QMAKE_CXXFLAGS += -Werror -ww177,1224,1478,1881 $$WERROR
        }
    } else:gcc:!clang:!intel_icc {
        # GCC 4.6-4.8
        ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
        contains(ver, "4\\.[678]") {
            QMAKE_CXXFLAGS += -Werror -Wno-error=cpp -Wno-error=deprecated-declarations $$WERROR

            # GCC prints this bogus warning, after it has inlined a lot of code
            # error: assuming signed overflow does not occur when assuming that (X + c) < X is always false
            QMAKE_CXXFLAGS += -Wno-error=strict-overflow

            # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135
            android: QMAKE_CXXFLAGS += -Wno-error=literal-suffix
        }
    }
    unset(ver)
}