summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2010-10-19 14:23:35 (GMT)
committerTor Arne Vestbø <tor.arne.vestbo@nokia.com>2010-10-20 17:40:11 (GMT)
commit1d4bf2d8a4c44f7d91dcde95b54cdd85e4b9b665 (patch)
tree852b1a4ab294d6d8a8de5fa5353592074c78a765 /mkspecs
parent28acb60009e0c40116da4897d21bcb47ef9663ee (diff)
downloadQt-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>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/mac/objective_c.prf25
1 files changed, 17 insertions, 8 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 = .