Move no-pch extra compiler to common features

As we add more classes with RValue ref qualified methods we will need
the same _compat trick and no-pch support as QString.

This patch moves the extra compiler to precompile_header.prf which is
automatically included when pch is used.

Change-Id: I422a355fd11f499ce0648a90b0385f2a6f699fcb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Allan Sandfeld Jensen 2014-01-06 16:41:53 +01:00 committed by The Qt Project
parent 6f1b82fccd
commit 635bfd6606
3 changed files with 27 additions and 12 deletions

View File

@ -82,5 +82,7 @@ breakpad {
!isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote($$QMAKE_STRIP $$DEBUGFILENAME)
}
!precompile_header: SOURCES += $$NO_PCH_SOURCES
QMAKE_INCDIR += $$QMAKE_INCDIR_POST
QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST

View File

@ -0,0 +1,24 @@
#
# 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.
#
#
# Set up extra compiler for PCH disabled sources
#
no_pch_compiler.commands = ${QMAKE_VAR_QMAKE_CXX} -c $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN}
msvc: no_pch_compiler.commands += -Fo${QMAKE_FILE_OUT}
else: no_pch_compiler.commands += -o ${QMAKE_FILE_OUT}
no_pch_compiler.dependency_type = TYPE_C
no_pch_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
no_pch_compiler.input = NO_PCH_SOURCES
no_pch_compiler.variable_out = OBJECTS
no_pch_compiler.name = compiling[no_pch] ${QMAKE_FILE_IN}
silent: no_pch_compiler.commands = @echo compiling[no_pch] ${QMAKE_FILE_IN} && $$no_pch_compiler.commands
QMAKE_EXTRA_COMPILERS += no_pch_compiler

View File

@ -115,7 +115,7 @@ SOURCES += \
tools/qvsnprintf.cpp
NO_PCH_SOURCES = tools/qstring_compat.cpp
false: SOURCES += $$NO_PCH_SOURCES
false: SOURCES += $$NO_PCH_SOURCES # Hack for QtCreator
!nacl:mac: {
SOURCES += tools/qelapsedtimer_mac.cpp
@ -198,14 +198,3 @@ INCLUDEPATH += ../3rdparty/md5 \
!macx-icc:!vxworks:unix:LIBS_PRIVATE += -lm
TR_EXCLUDE += ../3rdparty/*
no_pch_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN}
win32:!gcc:no_pch_compiler.commands += -Fo${QMAKE_FILE_OUT}
else:no_pch_compiler.commands += -o ${QMAKE_FILE_OUT}
no_pch_compiler.dependency_type = TYPE_C
no_pch_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
no_pch_compiler.input = NO_PCH_SOURCES
no_pch_compiler.variable_out = OBJECTS
no_pch_compiler.name = compiling[no_pch] ${QMAKE_FILE_IN}
silent:no_pch_compiler.commands = @echo compiling[no_pch] ${QMAKE_FILE_IN} && $$no_pch_compiler.commands
QMAKE_EXTRA_COMPILERS += no_pch_compiler