Move the sub-architecture feature to better places in qmake

Instead of saving the ability of the compiler to produce SSE2, AVX,
Neon, etc. code in .qmake.cache (Unix) or qconfig.pri (Windows), move
everything to qmodule.pri. Accordingly, move the DEFINES += settings
to qt_module.prf instead of qt.prf.

This allows us to re-use these settings in other Qt modules (other
than qtbase), if necessary. Though currently the extra compiler
definitions are found only in src/gui/gui.pro. They can be moved
elsewhere when it becomes necessary.

As a side-effect of this change, some other flags are moved from
.qmake.cache to qmodule.pri (on Unix). The flags that are getting
moved should probably be moved anyway.

Change-Id: Ibc3ab0111e148d81870772f9357273660aa93417
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Thiago Macieira 2012-05-30 14:44:39 +02:00 committed by Qt by Nokia
parent 05dc32ef6c
commit 6a6fd56e66
4 changed files with 21 additions and 20 deletions

4
configure vendored
View File

@ -5781,7 +5781,7 @@ fi
#-------------------------------------------------------------------------------
QTMODULE="$outpath/mkspecs/qmodule.pri"
echo "CONFIG += create_prl link_prl" >> "$QTMODULE.tmp"
echo "CONFIG += $QMAKE_CONFIG create_prl link_prl" >> "$QTMODULE.tmp"
# Ensure we can link to uninistalled libraries
if [ "$BUILD_ON_MAC" != "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ] && linkerSupportsFlag -rpath-link "$outpath/lib"; then
@ -5856,7 +5856,7 @@ QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include
QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
include(\$\$PWD/mkspecs/qmodule.pri)
CONFIG += $QMAKE_CONFIG dylib depend_includepath fix_output_dirs no_private_qt_headers_warning QTDIR_build
CONFIG += dylib depend_includepath fix_output_dirs no_private_qt_headers_warning QTDIR_build
EOF

View File

@ -175,16 +175,3 @@ wince*:static:gui {
mac {
!isEmpty(QT_NAMESPACE_MAC_CRC):DEFINES *= QT_NAMESPACE_MAC_CRC=$$QT_NAMESPACE_MAC_CRC
}
#SIMD defines:
sse2:DEFINES += QT_COMPILER_SUPPORTS_SSE2
sse3:DEFINES += QT_COMPILER_SUPPORTS_SSE3
ssse3:DEFINES += QT_COMPILER_SUPPORTS_SSSE3
sse4_1:DEFINES += QT_COMPILER_SUPPORTS_SSE4_1
sse4_2:DEFINES += QT_COMPILER_SUPPORTS_SSE4_2
avx:DEFINES += QT_COMPILER_SUPPORTS_AVX
avx2:DEFINES += QT_COMPILER_SUPPORTS_AVX2
iwmmxt:DEFINES += QT_COMPILER_SUPPORTS_IWMMXT
neon:DEFINES += QT_COMPILER_SUPPORTS_NEON
mips_dsp:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSP
mips_dspr2:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSPR2

View File

@ -31,3 +31,16 @@ mac {
# Qt modules get compiled without exceptions enabled by default
CONFIG += exceptions_off
#SIMD defines:
sse2:DEFINES += QT_COMPILER_SUPPORTS_SSE2
sse3:DEFINES += QT_COMPILER_SUPPORTS_SSE3
ssse3:DEFINES += QT_COMPILER_SUPPORTS_SSSE3
sse4_1:DEFINES += QT_COMPILER_SUPPORTS_SSE4_1
sse4_2:DEFINES += QT_COMPILER_SUPPORTS_SSE4_2
avx:DEFINES += QT_COMPILER_SUPPORTS_AVX
avx2:DEFINES += QT_COMPILER_SUPPORTS_AVX2
iwmmxt:DEFINES += QT_COMPILER_SUPPORTS_IWMMXT
neon:DEFINES += QT_COMPILER_SUPPORTS_NEON
mips_dsp:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSP
mips_dspr2:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSPR2

View File

@ -2533,7 +2533,12 @@ void Configure::generateCachefile()
if (!dictionary["DECORATIONS"].isEmpty())
moduleStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
moduleStream << "CONFIG += create_prl link_prl" << endl;
moduleStream << "CONFIG += create_prl link_prl";
if (dictionary[ "SSE2" ] == "yes")
moduleStream << " sse2";
if (dictionary[ "IWMMXT" ] == "yes")
moduleStream << " iwmmxt";
moduleStream << endl;
moduleStream.flush();
moduleFile.close();
@ -2668,10 +2673,6 @@ void Configure::generateQConfigPri()
configStream << " ltcg";
if (dictionary[ "RTTI" ] == "yes")
configStream << " rtti";
if (dictionary[ "SSE2" ] == "yes")
configStream << " sse2";
if (dictionary[ "IWMMXT" ] == "yes")
configStream << " iwmmxt";
if (dictionary["INCREDIBUILD_XGE"] == "yes")
configStream << " incredibuild_xge";
if (dictionary["PLUGIN_MANIFESTS"] == "no")