Refactor Qt project file into compiler specific subfiles

Encapsulating compiler specific options in a separate file
makes it easier to reason about what is going to happen on
a specific qmake call.

clang-msvc and msvc are separate because they don't support
exactly the same compiler switches.
This commit is contained in:
Vitaly
2019-02-21 18:48:53 +01:00
committed by username223
parent adcbb474c5
commit 4b48d051c8
6 changed files with 37 additions and 27 deletions
@@ -0,0 +1,9 @@
include(common-msvc.pri)
#win32-clang-msvc is unable to correctly build the first time
#with warnings as errors on. There seems to be an issue with the moc_predefs.h
#file not being built correctly when /WX is on. Until the issue is fixed,
#win32-clang-msvc is built without /WX.
#clang-msvc does not enable the c++17 flag with qmake's c++1z flag.
QMAKE_CXXFLAGS += /std:c++17
+3
View File
@@ -0,0 +1,3 @@
QMAKE_CXXFLAGS += -Werror
#All includes from the third-party directory will not warn.
QMAKE_CXXFLAGS += --system-header-prefix=third-party
@@ -0,0 +1,11 @@
#Removing -W3 from both FLAGS is necessary, otherwise compiler will give
#D9025: overriding '/W4' with '/W3'
QMAKE_CFLAGS_WARN_ON -= -W3
QMAKE_CXXFLAGS_WARN_ON -= -W3
#C4127 is a warning in qvarlengtharray.h that can not be turned off
#on the current version of MSVC.
QMAKE_CXXFLAGS += /W4 /wd4127
# The codecvt header being used in AudioManagerWindows.cpp is deprecated by the standard,
# but no suitable replacement has been standardized yet. It is possible to use the Windows
# specific MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h>
DEFINES += _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
+3
View File
@@ -0,0 +1,3 @@
#g++-7 is needed for C++17 features. travis does not supply this by default.
QMAKE_CXX = g++-7
QMAKE_CXXFLAGS += -Werror
+3
View File
@@ -0,0 +1,3 @@
include(common-msvc.pri)
QMAKE_CXXFLAGS += /WX