diff options
author | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2010-10-19 14:23:35 (GMT) |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2010-10-20 17:40:11 (GMT) |
commit | 1d4bf2d8a4c44f7d91dcde95b54cdd85e4b9b665 (patch) | |
tree | 852b1a4ab294d6d8a8de5fa5353592074c78a765 | |
parent | 28acb60009e0c40116da4897d21bcb47ef9663ee (diff) | |
download | Qt-1d4bf2d8a4c44f7d91dcde95b54cdd85e4b9b665.zip Qt-1d4bf2d8a4c44f7d91dcde95b54cdd85e4b9b665.tar.gz Qt-1d4bf2d8a4c44f7d91dcde95b54cdd85e4b9b665.tar.bz2 |
Handle Objective-C/C++ sources in SOURCES gracefully
We look though SOURCES for Objective-C/C++ source files and if we find
any we warn the user and move the offending file to OBJECTIVE_SOURCES.
We also don't generate implicit rules for .mm files anymore, since
that's not supported by qmake and will break in mysterious ways.
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
-rw-r--r-- | mkspecs/features/mac/objective_c.prf | 25 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebCore/WebCore.pro | 6 | ||||
-rw-r--r-- | src/qbase.pri | 1 |
3 files changed, 20 insertions, 12 deletions
diff --git a/mkspecs/features/mac/objective_c.prf b/mkspecs/features/mac/objective_c.prf index 0df7013..ca693ba 100644 --- a/mkspecs/features/mac/objective_c.prf +++ b/mkspecs/features/mac/objective_c.prf @@ -1,13 +1,22 @@ +for(source, SOURCES) { + contains(source,.*\\.mm?$) { + warning(Objective-C source \'$$source\' found in SOURCES but should be in OBJECTIVE_SOURCES) + SOURCES -= $$source + OBJECTIVE_SOURCES += $$source + } +} + isEmpty(QMAKE_OBJECTIVE_CC):QMAKE_OBJECTIVE_CC = $$QMAKE_CC - QMAKE_OBJECTIVE_CFLAGS = $$QMAKE_CFLAGS - QMAKE_OBJECTIVE_CFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON - QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF - QMAKE_OBJECTIVE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG - QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE - QMAKE_OBJECTIVE_CFLAGS_X86 = $$QMAKE_CFLAGS_X86 - QMAKE_OBJECTIVE_CFLAGS_PPC = $$QMAKE_CFLAGS_PPC - QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS + +QMAKE_OBJECTIVE_CFLAGS = $$QMAKE_CFLAGS +QMAKE_OBJECTIVE_CFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON +QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF +QMAKE_OBJECTIVE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG +QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE +QMAKE_OBJECTIVE_CFLAGS_X86 = $$QMAKE_CFLAGS_X86 +QMAKE_OBJECTIVE_CFLAGS_PPC = $$QMAKE_CFLAGS_PPC +QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS OBJECTIVE_C_OBJECTS_DIR = $$OBJECTS_DIR isEmpty(OBJECTIVE_C_OBJECTS_DIR):OBJECTIVE_C_OBJECTS_DIR = . diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 981dba2..63bde2f 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -2180,11 +2180,11 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) { mac { SOURCES += \ - plugins/mac/PluginPackageMac.cpp \ - plugins/mac/PluginViewMac.mm + plugins/mac/PluginPackageMac.cpp OBJECTIVE_SOURCES += \ platform/text/mac/StringImplMac.mm \ - platform/mac/WebCoreNSStringExtras.mm + platform/mac/WebCoreNSStringExtras.mm \ + plugins/mac/PluginViewMac.mm INCLUDEPATH += platform/mac # Note: XP_MACOSX is defined in npapi.h } else { diff --git a/src/qbase.pri b/src/qbase.pri index 30f3337..933b91e 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -8,7 +8,6 @@ isEmpty(QT_MAJOR_VERSION) { } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } -mac:!contains(QMAKE_EXT_C, .mm):QMAKE_EXT_C += .mm #load up the headers info CONFIG += qt_install_headers |