summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2011-02-14 14:57:01 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2011-03-15 14:56:03 (GMT)
commitc35f610219b1d09f6d05215a2e2fe4f2f6bd966c (patch)
tree6301609af836a44a2d1489041a0479ee9dc3e75a /qmake
parentc0cd8db0498daaa8151d1f80143b6849016bdc7c (diff)
downloadQt-c35f610219b1d09f6d05215a2e2fe4f2f6bd966c.zip
Qt-c35f610219b1d09f6d05215a2e2fe4f2f6bd966c.tar.gz
Qt-c35f610219b1d09f6d05215a2e2fe4f2f6bd966c.tar.bz2
qmake vcproj generator: support PCHs with other extensions than .h
Task-number: QTBUG-16639 Reviewed-by: Marius Storm-Olsen
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp2
-rw-r--r--qmake/option.h9
2 files changed, 9 insertions, 2 deletions
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 69cfc0d..3253c3b 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2104,7 +2104,7 @@ void VCFilter::modifyPCHstage(QString str)
break;
}
}
- bool isHFile = str.endsWith(".h") && (str == Project->precompH);
+ bool isHFile = Option::hasFileExtension(str, Option::h_ext) && (str == Project->precompH);
bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP);
if(!isCFile && !isHFile && !isCPPFile)
diff --git a/qmake/option.h b/qmake/option.h
index e3ddc9a..bc87343 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -139,6 +139,14 @@ struct Option
return fixString(in, flags);
}
+ inline static bool hasFileExtension(const QString &str, const QStringList &extensions)
+ {
+ foreach (const QString &ext, extensions)
+ if (str.endsWith(ext))
+ return true;
+ return false;
+ }
+
//global qmake mode, can only be in one mode per invocation!
enum QMAKE_MODE { QMAKE_GENERATE_NOTHING, QMAKE_GENERATE_PROJECT, QMAKE_GENERATE_MAKEFILE,
QMAKE_GENERATE_PRL, QMAKE_SET_PROPERTY, QMAKE_QUERY_PROPERTY };
@@ -195,7 +203,6 @@ private:
inline QString fixEnvVariables(const QString &x) { return Option::fixString(x, Option::FixEnvVars); }
inline QStringList splitPathList(const QString &paths) { return paths.split(Option::dirlist_sep); }
-
// this is a stripped down version of the one found in QtCore
class QLibraryInfo
{