diff options
| author | tastytea <tastytea@tastytea.de> | 2021-04-09 20:15:04 +0200 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-04-10 10:03:03 +0200 |
| commit | 7074170f69fdf8b4d41954ab42d48fea971293b3 (patch) | |
| tree | ea17174cffcd30d5ec36b68ff20bd518c0d504d1 /src | |
| parent | 60d3e221c0f799cad71d5e539b896ab26246b381 (diff) | |
| download | kristall-7074170f69fdf8b4d41954ab42d48fea971293b3.tar.gz | |
Respect *FLAGS environment variables.
This initializes QMAKE_CFLAGS, QMAKE_CXXFLAGS and QMAKE_LFLAGS with the
corresponding environment variables on all OSs. The variables will be
expanded when qmake is run[1].
This is a generalization of #171.
[1] <https://doc.qt.io/archives/qt-4.8/qmake-advanced-usage.html#variables>
Diffstat (limited to 'src')
| -rw-r--r-- | src/kristall.pro | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/kristall.pro b/src/kristall.pro index 1bef7b3..e286d71 100644 --- a/src/kristall.pro +++ b/src/kristall.pro @@ -21,15 +21,11 @@ DEFINES += KRISTALL_VERSION="\"$(shell cd $$PWD; git describe --tags)\"" # We need iconv on non-linux platforms !linux: LIBS += -liconv -# On linux systems that have dpkg, append build flags for hardening -linux { - system("which dpkg-buildflags") { - QMAKE_CPPFLAGS *= $(shell dpkg-buildflags --get CPPFLAGS) - QMAKE_CFLAGS *= $(shell dpkg-buildflags --get CFLAGS) - QMAKE_CXXFLAGS *= $(shell dpkg-buildflags --get CXXFLAGS) - QMAKE_LFLAGS *= $(shell dpkg-buildflags --get LDFLAGS) - } -} +# Initialize build flags from environment variables. +QMAKE_CFLAGS *= $$(CFLAGS) +QMAKE_CXXFLAGS *= $$(CXXFLAGS) +QMAKE_CPPFLAGS *= $$(CPPFLAGS) +QMAKE_LFLAGS *= $$(LDFLAGS) QMAKE_CFLAGS += -Wno-unused-parameter -Werror=return-type QMAKE_CXXFLAGS += -Wno-unused-parameter -Werror=return-type |
