aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/proparser
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/proparser')
-rw-r--r--src/shared/proparser/objective_c.prf12
-rw-r--r--src/shared/proparser/proparser.pri2
-rw-r--r--src/shared/proparser/proparser.qrc3
-rw-r--r--src/shared/proparser/qmakeevaluator.cpp39
4 files changed, 41 insertions, 15 deletions
diff --git a/src/shared/proparser/objective_c.prf b/src/shared/proparser/objective_c.prf
new file mode 100644
index 0000000000..ed1ad8ad38
--- /dev/null
+++ b/src/shared/proparser/objective_c.prf
@@ -0,0 +1,12 @@
+
+# Objective-C/C++ sources go in SOURCES, like all other sources
+SOURCES += $$OBJECTIVE_SOURCES
+unset(OBJECTIVE_SOURCES)
+
+# Strip C/C++ flags from QMAKE_OBJECTIVE_CFLAGS just in case
+QMAKE_OBJECTIVE_CFLAGS -= $$QMAKE_CFLAGS $$QMAKE_CXXFLAGS
+
+# Add Objective-C/C++ flags to C/C++ flags, the compiler can handle it
+QMAKE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS
+QMAKE_CXXFLAGS += $$QMAKE_OBJECTIVE_CFLAGS
+unset(QMAKE_OBJECTIVE_CFLAGS)
diff --git a/src/shared/proparser/proparser.pri b/src/shared/proparser/proparser.pri
index a3667e5291..53ab86cf57 100644
--- a/src/shared/proparser/proparser.pri
+++ b/src/shared/proparser/proparser.pri
@@ -29,4 +29,4 @@ SOURCES += \
ioutils.cpp
RESOURCES += proparser.qrc
-DEFINES += QMAKE_BUILTIN_PRFS
+DEFINES += QMAKE_BUILTIN_PRFS QMAKE_OVERRIDE_PRFS
diff --git a/src/shared/proparser/proparser.qrc b/src/shared/proparser/proparser.qrc
index 9193eaa31c..10f360fa49 100644
--- a/src/shared/proparser/proparser.qrc
+++ b/src/shared/proparser/proparser.qrc
@@ -3,4 +3,7 @@
<file>spec_pre.prf</file>
<file>spec_post.prf</file>
</qresource>
+ <qresource prefix="/qmake/override_features" >
+ <file>objective_c.prf</file>
+ </qresource>
</RCC>
diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp
index 19e9f8b232..5e318b170d 100644
--- a/src/shared/proparser/qmakeevaluator.cpp
+++ b/src/shared/proparser/qmakeevaluator.cpp
@@ -1953,23 +1953,34 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile(
// needs to be determined. Failed lookups are represented via non-null empty strings.
QString *fnp = &m_featureRoots->cache[qMakePair(fn, currFn)];
if (fnp->isNull()) {
- int start_root = 0;
- const QStringList &paths = m_featureRoots->paths;
- if (!currFn.isEmpty()) {
- QStringRef currPath = IoUtils::pathName(currFn);
- for (int root = 0; root < paths.size(); ++root)
- if (currPath == paths.at(root)) {
- start_root = root + 1;
- break;
- }
- }
- for (int root = start_root; root < paths.size(); ++root) {
- QString fname = paths.at(root) + fn;
- if (IoUtils::exists(fname)) {
- fn = fname;
+#ifdef QMAKE_OVERRIDE_PRFS
+ {
+ QString ovrfn(QLatin1String(":/qmake/override_features/") + fn);
+ if (QFileInfo::exists(ovrfn)) {
+ fn = ovrfn;
goto cool;
}
}
+#endif
+ {
+ int start_root = 0;
+ const QStringList &paths = m_featureRoots->paths;
+ if (!currFn.isEmpty()) {
+ QStringRef currPath = IoUtils::pathName(currFn);
+ for (int root = 0; root < paths.size(); ++root)
+ if (currPath == paths.at(root)) {
+ start_root = root + 1;
+ break;
+ }
+ }
+ for (int root = start_root; root < paths.size(); ++root) {
+ QString fname = paths.at(root) + fn;
+ if (IoUtils::exists(fname)) {
+ fn = fname;
+ goto cool;
+ }
+ }
+ }
#ifdef QMAKE_BUILTIN_PRFS
fn.prepend(QLatin1String(":/qmake/features/"));
if (QFileInfo::exists(fn))