summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/global.pri
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-09-17 11:35:36 -0700
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-09-21 15:22:49 +0000
commit05d401104ee6b10699b7288ead044d6765b19c4d (patch)
tree0909ed270cf051721ab528bd7baf5d16db1b9c29 /src/corelib/global/global.pri
parent67d4052be5f9b04bcb40d419370859fe71657d62 (diff)
Fix QtCore compilation with clang
The .altmacro is not supported with Clang's integrated assembly. The worst part is that I had this fixed, but apparently I never pushed the update to Gerrit and then we staged the old version. This commit brings back the fixes. Incidentally, it also makes things work with freebsd-clang. Change-Id: Id2a5d90d07d7ee470fcb9ad9696a9a0f9ced7ea7 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/corelib/global/global.pri')
-rw-r--r--src/corelib/global/global.pri28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 8ecde5a769..eb8600f796 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -27,8 +27,7 @@ SOURCES += \
global/qmalloc.cpp \
global/qnumeric.cpp \
global/qlogging.cpp \
- global/qhooks.cpp \
- global/qversiontagging.cpp
+ global/qhooks.cpp
# qlibraryinfo.cpp includes qconfig.cpp
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
@@ -59,3 +58,28 @@ journald {
syslog {
DEFINES += QT_USE_SYSLOG
}
+
+linux|freebsd {
+ VERSIONTAGGING_SOURCES = global/qversiontagging.cpp
+ ltcg|clang {
+ versiontagging_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) $(INCPATH)
+
+ # Disable LTO, as the global inline assembly may not get processed
+ versiontagging_compiler.commands += -fno-lto
+
+ # Disable the integrated assembler for Clang, since it can't parse with
+ # the alternate macro syntax in use in qversiontagging.cpp
+ clang: versiontagging_compiler.commands += -no-integrated-as
+
+ versiontagging_compiler.commands += -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ versiontagging_compiler.dependency_type = TYPE_C
+ versiontagging_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ versiontagging_compiler.input = VERSIONTAGGING_SOURCES
+ versiontagging_compiler.variable_out = OBJECTS
+ versiontagging_compiler.name = compiling[versiontagging] ${QMAKE_FILE_IN}
+ silent: versiontagging_compiler.commands = @echo compiling[versiontagging] ${QMAKE_FILE_IN} && $$versiontagging_compiler.commands
+ QMAKE_EXTRA_COMPILERS += versiontagging_compiler
+ } else {
+ SOURCES += $$VERSIONTAGGING_SOURCES
+ }
+}