From 483e56866dfca34c80391a34763e962e497454d9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 29 Jul 2016 21:04:53 +0300 Subject: [PATCH] Added MSVC warnings. --HG-- branch : develop --- common.pri | 37 ++++++ src/app/tape/tape.pro | 13 +- src/app/tape/warnings.pri | 114 ++++++++++------- src/app/valentina/valentina.pro | 13 +- src/app/valentina/warnings.pri | 120 ++++++++++-------- src/libs/fervor/fervor.pro | 16 +-- src/libs/fervor/warnings.pri | 96 ++++++++------ src/libs/ifc/ifc.pro | 16 +-- src/libs/ifc/warnings.pri | 100 +++++++++------ src/libs/qmuparser/qmuparser.pro | 16 +-- src/libs/qmuparser/warnings.pri | 90 +++++++------ src/libs/vdxf/vdxf.pro | 16 +-- src/libs/vdxf/warnings.pri | 90 +++++++------ src/libs/vformat/vformat.pro | 16 +-- src/libs/vformat/warnings.pri | 90 +++++++------ src/libs/vgeometry/vgeometry.pro | 16 +-- src/libs/vgeometry/warnings.pri | 90 +++++++------ src/libs/vlayout/vlayout.pro | 16 +-- src/libs/vlayout/warnings.pri | 116 ++++++++++------- src/libs/vmisc/vmisc.pro | 14 +- src/libs/vmisc/warnings.pri | 100 +++++++++------ src/libs/vobj/vobj.pro | 16 +-- src/libs/vobj/warnings.pri | 90 +++++++------ src/libs/vpatterndb/vpatterndb.pro | 16 +-- src/libs/vpatterndb/warnings.pri | 90 +++++++------ .../vpropertyexplorer/vpropertyexplorer.pro | 12 +- src/libs/vpropertyexplorer/warnings.pri | 108 +++++++++------- src/libs/vtools/vtools.pro | 16 +-- src/libs/vtools/warnings.pri | 106 +++++++++------- src/libs/vwidgets/vwidgets.pro | 16 +-- src/libs/vwidgets/warnings.pri | 100 +++++++++------ src/test/ParserTest/ParserTest.pro | 16 +-- src/test/ParserTest/warnings.pri | 90 +++++++------ src/test/ValentinaTest/ValentinaTest.pro | 17 +-- src/test/ValentinaTest/warnings.pri | 104 ++++++++------- 35 files changed, 1071 insertions(+), 921 deletions(-) diff --git a/common.pri b/common.pri index e7cc828b0..e37739adb 100644 --- a/common.pri +++ b/common.pri @@ -675,4 +675,41 @@ CLANG_DEBUG_CXXFLAGS += \ -pedantic \ -fno-omit-frame-pointer \ # Need for exchndl.dll -fms-extensions # Need for pragma message + +MSVC_DEBUG_CXXFLAGS += \ + -Wall \ + -wd4061 \ # enum value is not *explicitly* handled in switch + -wd4099 \ # first seen using 'struct' now seen using 'class' + -wd4127 \ # conditional expression is constant + -wd4217 \ # member template isn't copy constructor + -wd4250 \ # inherits (implements) some member via dominance + -wd4251 \ # needs to have dll-interface to be used by clients + -wd4275 \ # exported class derived from non-exported class + -wd4347 \ # "behavior change", function called instead of template + -wd4355 \ # "'this': used in member initializer list + -wd4505 \ # unreferenced function has been removed + -wd4510 \ # default constructor could not be generated + -wd4511 \ # copy constructor could not be generated + -wd4512 \ # assignment operator could not be generated + -wd4513 \ # destructor could not be generated + -wd4610 \ # can never be instantiated user defined constructor required + -wd4623 \ # default constructor could not be generated + -wd4624 \ # destructor could not be generated + -wd4625 \ # copy constructor could not be generated + -wd4626 \ # assignment operator could not be generated + -wd4640 \ # a local static object is not thread-safe + -wd4661 \ # a member of the template class is not defined. + -wd4670 \ # a base class of an exception class is inaccessible for catch + -wd4672 \ # a base class of an exception class is ambiguous for catch + -wd4673 \ # a base class of an exception class is inaccessible for catch + -wd4675 \ # resolved overload was found by argument-dependent lookup + -wd4702 \ # unreachable code, e.g. in header. + -wd4710 \ # call was not inlined + -wd4711 \ # call was inlined + -wd4820 \ # some padding was added + -wd4917 \ # a GUID can only be associated with a class, interface or namespace + # The following are real warnings but are generated by almost all MS headers, including + # standard library headers, so it's impractical to leave them on. + -wd4619 \ # there is no warning number 'XXXX' + -wd4668 # XXX is not defined as a preprocessor macro } diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index 8acecf751..cc66b7ee3 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -264,15 +264,10 @@ OTHER_FILES += \ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() +include(warnings.pri) + CONFIG(debug, debug|release){ # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } DEFINES += "BUILD_REVISION=\\\"unknown\\\"" }else{ # Release mode @@ -282,10 +277,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols DEFINES += V_NO_DEBUG } else { diff --git a/src/app/tape/warnings.pri b/src/app/tape/warnings.pri index 9a4697481..87af1d22b 100644 --- a/src/app/tape/warnings.pri +++ b/src/app/tape/warnings.pri @@ -1,54 +1,72 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wundefined-reinterpret-cast \ - -Wmissing-prototypes # rcc folder -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast \ + -Wmissing-prototypes # rcc folder + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index 79d7dc143..faff1b32a 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -63,17 +63,10 @@ OTHER_FILES += \ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() +include(warnings.pri) CONFIG(debug, debug|release){ # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } - #Calculate latest tag distance and build revision only in release mode. Change number each time requare #recompilation precompiled headers file. DEFINES += "LATEST_TAG_DISTANCE=0" @@ -86,10 +79,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols DEFINES += V_NO_DEBUG } else { diff --git a/src/app/valentina/warnings.pri b/src/app/valentina/warnings.pri index 2e87a116f..551b4d7dd 100644 --- a/src/app/valentina/warnings.pri +++ b/src/app/valentina/warnings.pri @@ -1,57 +1,75 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - -isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + -isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - -isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wmissing-prototypes \ - -Wundefined-reinterpret-cast -} - -*-icc-*{ - QMAKE_CXXFLAGS+= \ - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - -isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + -isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wmissing-prototypes \ + -Wundefined-reinterpret-cast + } + + *-icc-*{ + QMAKE_CXXFLAGS+= \ + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + -isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/fervor/fervor.pro b/src/libs/fervor/fervor.pro index 63eaae37e..f7b7bd134 100644 --- a/src/libs/fervor/fervor.pro +++ b/src/libs/fervor/fervor.pro @@ -45,17 +45,9 @@ UI_DIR = uic # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent DEFINES += V_NO_ASSERT @@ -63,10 +55,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/fervor/warnings.pri b/src/libs/fervor/warnings.pri index 8bd738583..7d96fb90c 100644 --- a/src/libs/fervor/warnings.pri +++ b/src/libs/fervor/warnings.pri @@ -1,45 +1,63 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/ifc/ifc.pro b/src/libs/ifc/ifc.pro index 775c917d2..aebea6785 100644 --- a/src/libs/ifc/ifc.pro +++ b/src/libs/ifc/ifc.pro @@ -53,17 +53,9 @@ RESOURCES += \ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent DEFINES += V_NO_ASSERT @@ -71,10 +63,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/ifc/warnings.pri b/src/libs/ifc/warnings.pri index be993a88e..7bd4cb533 100644 --- a/src/libs/ifc/warnings.pri +++ b/src/libs/ifc/warnings.pri @@ -1,51 +1,69 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings QMAKE_CXXFLAGS += -Werror } - # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wmissing-prototypes \ - -Wundefined-reinterpret-cast -} + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } + } -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wmissing-prototypes \ + -Wundefined-reinterpret-cast + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/qmuparser/qmuparser.pro b/src/libs/qmuparser/qmuparser.pro index 154b90fea..d4fa0a8f7 100644 --- a/src/libs/qmuparser/qmuparser.pro +++ b/src/libs/qmuparser/qmuparser.pro @@ -65,17 +65,9 @@ unix:!macx{ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent @@ -83,10 +75,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noStripDebugSymbols { # do nothing } else { diff --git a/src/libs/qmuparser/warnings.pri b/src/libs/qmuparser/warnings.pri index 5e56557c8..ff2a24472 100644 --- a/src/libs/qmuparser/warnings.pri +++ b/src/libs/qmuparser/warnings.pri @@ -1,42 +1,60 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vdxf/vdxf.pro b/src/libs/vdxf/vdxf.pro index 311cf10bc..4773a3c50 100644 --- a/src/libs/vdxf/vdxf.pro +++ b/src/libs/vdxf/vdxf.pro @@ -40,17 +40,9 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode CONFIG += silent @@ -58,10 +50,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/vdxf/warnings.pri b/src/libs/vdxf/warnings.pri index 5e56557c8..ff2a24472 100644 --- a/src/libs/vdxf/warnings.pri +++ b/src/libs/vdxf/warnings.pri @@ -1,42 +1,60 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vformat/vformat.pro b/src/libs/vformat/vformat.pro index 3c62a9720..5c05f91ec 100644 --- a/src/libs/vformat/vformat.pro +++ b/src/libs/vformat/vformat.pro @@ -46,17 +46,9 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent DEFINES += V_NO_ASSERT @@ -64,10 +56,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/vformat/warnings.pri b/src/libs/vformat/warnings.pri index 5e56557c8..ff2a24472 100644 --- a/src/libs/vformat/warnings.pri +++ b/src/libs/vformat/warnings.pri @@ -1,42 +1,60 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vgeometry/vgeometry.pro b/src/libs/vgeometry/vgeometry.pro index 524c6379f..bf5d22fe8 100644 --- a/src/libs/vgeometry/vgeometry.pro +++ b/src/libs/vgeometry/vgeometry.pro @@ -42,17 +42,9 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent @@ -60,10 +52,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/vgeometry/warnings.pri b/src/libs/vgeometry/warnings.pri index 5e56557c8..ff2a24472 100644 --- a/src/libs/vgeometry/warnings.pri +++ b/src/libs/vgeometry/warnings.pri @@ -1,42 +1,60 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro index de7ae8b22..6968632f9 100644 --- a/src/libs/vlayout/vlayout.pro +++ b/src/libs/vlayout/vlayout.pro @@ -45,17 +45,9 @@ RCC_DIR = rcc # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent DEFINES += V_NO_ASSERT @@ -63,10 +55,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - QMAKE_CXXFLAGS -= -O2 # Disable default optimization level QMAKE_CXXFLAGS += -O3 # For vlayout library enable speed optimizations diff --git a/src/libs/vlayout/warnings.pri b/src/libs/vlayout/warnings.pri index a3e5bcdf5..becf41bff 100644 --- a/src/libs/vlayout/warnings.pri +++ b/src/libs/vlayout/warnings.pri @@ -1,56 +1,74 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in the global list. Compromise decision is to delete them from the local list. + QMAKE_CXXFLAGS -= \ + -Wlong-long \ + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and - # want them in the global list. Compromise decision is to delete them from the local list. - QMAKE_CXXFLAGS -= \ - -Wlong-long \ + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wundefined-reinterpret-cast \ - -Wmissing-prototypes # rcc folder -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast \ + -Wmissing-prototypes # rcc folder + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vmisc/vmisc.pro b/src/libs/vmisc/vmisc.pro index 2a8d84769..d9c2f60bc 100644 --- a/src/libs/vmisc/vmisc.pro +++ b/src/libs/vmisc/vmisc.pro @@ -48,16 +48,10 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() +include(warnings.pri) + CONFIG(debug, debug|release){ # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } - #Calculate latest tag distance and build revision only in release mode. Change number each time requare #recompilation precompiled headers file. DEFINES += "LATEST_TAG_DISTANCE=0" @@ -70,10 +64,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/vmisc/warnings.pri b/src/libs/vmisc/warnings.pri index e94434007..369388a1f 100644 --- a/src/libs/vmisc/warnings.pri +++ b/src/libs/vmisc/warnings.pri @@ -1,47 +1,65 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wmissing-prototypes -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wmissing-prototypes + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vobj/vobj.pro b/src/libs/vobj/vobj.pro index bee46b371..71c21f01d 100644 --- a/src/libs/vobj/vobj.pro +++ b/src/libs/vobj/vobj.pro @@ -40,17 +40,9 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent @@ -58,10 +50,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/vobj/warnings.pri b/src/libs/vobj/warnings.pri index 5e56557c8..ff2a24472 100644 --- a/src/libs/vobj/warnings.pri +++ b/src/libs/vobj/warnings.pri @@ -1,42 +1,60 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vpatterndb/vpatterndb.pro b/src/libs/vpatterndb/vpatterndb.pro index 7a530554d..58721f725 100644 --- a/src/libs/vpatterndb/vpatterndb.pro +++ b/src/libs/vpatterndb/vpatterndb.pro @@ -43,17 +43,9 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent @@ -61,10 +53,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/vpatterndb/warnings.pri b/src/libs/vpatterndb/warnings.pri index 5e56557c8..ff2a24472 100644 --- a/src/libs/vpatterndb/warnings.pri +++ b/src/libs/vpatterndb/warnings.pri @@ -1,42 +1,60 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pro b/src/libs/vpropertyexplorer/vpropertyexplorer.pro index 2af77b837..d2c2ab78b 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pro +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pro @@ -63,17 +63,9 @@ unix:!macx{ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent diff --git a/src/libs/vpropertyexplorer/warnings.pri b/src/libs/vpropertyexplorer/warnings.pri index fcf8e2aeb..da106d629 100644 --- a/src/libs/vpropertyexplorer/warnings.pri +++ b/src/libs/vpropertyexplorer/warnings.pri @@ -1,52 +1,70 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - # Key -isystem disable checking errors in system headers. - $$GCC_DEBUG_CXXFLAGS \ # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + # Key -isystem disable checking errors in system headers. + $$GCC_DEBUG_CXXFLAGS \ # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wswitch-default + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wswitch-default + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wundefined-reinterpret-cast -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vtools/vtools.pro b/src/libs/vtools/vtools.pro index 0041fa51d..6343736a2 100644 --- a/src/libs/vtools/vtools.pro +++ b/src/libs/vtools/vtools.pro @@ -50,17 +50,9 @@ $$enable_ccache() INCLUDEPATH += $$PWD/../vpatterndb -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent DEFINES += V_NO_ASSERT @@ -68,10 +60,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/vtools/warnings.pri b/src/libs/vtools/warnings.pri index ac67d588c..6002b6d88 100644 --- a/src/libs/vtools/warnings.pri +++ b/src/libs/vtools/warnings.pri @@ -1,50 +1,68 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ -# -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + # -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wundefined-reinterpret-cast -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/libs/vwidgets/vwidgets.pro b/src/libs/vwidgets/vwidgets.pro index 8dd99831c..7a8f4a0ea 100644 --- a/src/libs/vwidgets/vwidgets.pro +++ b/src/libs/vwidgets/vwidgets.pro @@ -42,17 +42,9 @@ OBJECTS_DIR = obj # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent @@ -60,10 +52,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/libs/vwidgets/warnings.pri b/src/libs/vwidgets/warnings.pri index 9c68dfe1c..cf660342f 100644 --- a/src/libs/vwidgets/warnings.pri +++ b/src/libs/vwidgets/warnings.pri @@ -1,47 +1,65 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wundefined-reinterpret-cast -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/test/ParserTest/ParserTest.pro b/src/test/ParserTest/ParserTest.pro index e1fe7c9c2..ae16eb9e2 100644 --- a/src/test/ParserTest/ParserTest.pro +++ b/src/test/ParserTest/ParserTest.pro @@ -49,25 +49,13 @@ win32-msvc*:SOURCES += stable.cpp # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } +include(warnings.pri) -}else{ +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent DEFINES += QT_NO_DEBUG_OUTPUT - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/test/ParserTest/warnings.pri b/src/test/ParserTest/warnings.pri index 9f37c06ac..171189489 100644 --- a/src/test/ParserTest/warnings.pri +++ b/src/test/ParserTest/warnings.pri @@ -1,42 +1,60 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } - - # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wmissing-prototypes -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wmissing-prototypes + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } } diff --git a/src/test/ValentinaTest/ValentinaTest.pro b/src/test/ValentinaTest/ValentinaTest.pro index af2d83636..3673f84c6 100644 --- a/src/test/ValentinaTest/ValentinaTest.pro +++ b/src/test/ValentinaTest/ValentinaTest.pro @@ -76,16 +76,9 @@ HEADERS += \ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -CONFIG(debug, debug|release){ - # Debug mode - unix { - include(warnings.pri) - } else { - *-g++{ - QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - } - } -}else{ +include(warnings.pri) + +CONFIG(release, debug|release){ # Release mode !win32-msvc*:CONFIG += silent DEFINES += V_NO_ASSERT @@ -93,10 +86,6 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll } - checkWarnings{ - unix:include(warnings.pri) - } - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/test/ValentinaTest/warnings.pri b/src/test/ValentinaTest/warnings.pri index 3d7b19eed..c6d8b3c0d 100644 --- a/src/test/ValentinaTest/warnings.pri +++ b/src/test/ValentinaTest/warnings.pri @@ -1,49 +1,67 @@ #Turn on compilers warnings. -*-g++{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. +unix { + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } } - noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer - # do nothing - } else { - #gcc’s 4.8.0 Address Sanitizer - #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ - QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer - QMAKE_LFLAGS += -fsanitize=address - } -} - -clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS \ # See common.pri for more details. - -Wno-gnu-zero-variadic-macro-arguments\ # See macros QSKIP - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror - } -} - -*-icc-*{ - QMAKE_CXXFLAGS += \ - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$ICC_DEBUG_CXXFLAGS - - checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings - QMAKE_CXXFLAGS += -Werror + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS \ # See common.pri for more details. + -Wno-gnu-zero-variadic-macro-arguments\ # See macros QSKIP + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + *-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } +} else { # Windows + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + } + + win32-msvc*{ + QMAKE_CXXFLAGS += $$MSVC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + #QMAKE_CXXFLAGS += -WX + } } }