summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix14
-rw-r--r--qmake/Makefile.win322
-rw-r--r--qmake/Makefile.win32-g++8
-rw-r--r--qmake/Makefile.win32-g++-sh8
-rw-r--r--qmake/cachekeys.h48
-rw-r--r--qmake/generators/makefile.cpp18
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp34
-rw-r--r--qmake/option.cpp12
8 files changed, 58 insertions, 86 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index fd502e0..9dbe035 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -21,7 +21,8 @@ QOBJS=qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qgl
qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o \
qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o \
qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o \
- qlocale.o qlinkedlist.o qurl.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o \
+ qlocale.o qlocale_tools.o qlocale_unix.o qlinkedlist.o qurl.o qnumeric.o qcryptographichash.o \
+ qxmlstream.o qxmlutils.o \
$(QTOBJS)
@@ -58,7 +59,10 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
$(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \
$(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp $(SOURCE_PATH)/src/corelib/tools/qmap.cpp \
$(SOURCE_PATH)/src/corelib/global/qconfig.cpp $(SOURCE_PATH)/src/corelib/io/qurl.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \
+ $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \
+ $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp \
+ $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp \
+ $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \
$(SOURCE_PATH)/src/corelib/tools/qhash.cpp $(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp \
$(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp \
$(SOURCE_PATH)/src/corelib/io/qsettings.cpp $(SOURCE_PATH)/src/corelib/kernel/qvariant.cpp \
@@ -158,6 +162,12 @@ qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
+
+qlocale_unix.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp
+
qdatastream.o: $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 0ab2932..6fd3939 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -98,6 +98,8 @@ QTOBJS= \
qlist.obj \
qlinkedlist.obj \
qlocale.obj \
+ qlocale_tools.obj \
+ qlocale_win.obj \
qmalloc.obj \
qmap.obj \
qregexp.obj \
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index cba4257..d40dc29 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -75,6 +75,8 @@ QTOBJS= \
qlist.o \
qlinkedlist.o \
qlocale.o \
+ qlocale_tools.o \
+ qlocale_win.o \
qmalloc.o \
qmap.o \
qregexp.o \
@@ -176,6 +178,12 @@ qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
+
+qlocale_win.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp
+
quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index 0d3bb68..49ccfbc 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -75,6 +75,8 @@ QTOBJS= \
qlist.o \
qlinkedlist.o \
qlocale.o \
+ qlocale_tools.o \
+ qlocale_win.o \
qmalloc.o \
qmap.o \
qregexp.o \
@@ -175,6 +177,12 @@ qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
+
+qlocale_win.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp
+
quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
diff --git a/qmake/cachekeys.h b/qmake/cachekeys.h
index 2957d61..b29e4f2 100644
--- a/qmake/cachekeys.h
+++ b/qmake/cachekeys.h
@@ -118,54 +118,6 @@ struct FileInfoCacheKey
inline uint qHash(const FileInfoCacheKey &f) { return f.hashCode(); }
// -------------------------------------------------------------------------------------------------
-struct FileFixifyCacheKey
-{
- mutable uint hash;
- QString in_d, out_d;
- QString file, pwd;
- uint fixType;
- bool canonicalize;
- FileFixifyCacheKey(const QString &f, const QString &od, const QString &id,
- uint ft, bool c)
- {
- hash = 0;
- pwd = qmake_getpwd();
- file = f;
- if(od.isNull())
- out_d = Option::output_dir;
- else
- out_d = od;
- if(id.isNull())
- in_d = qmake_getpwd();
- else
- in_d = id;
- fixType = ft;
- canonicalize = c;
- }
- QString toString() const {
- return file + "--" + in_d + "--" + out_d + "--" + pwd + "--" +
- QString::number(fixType) + "--" + QString::number((int)canonicalize);
- }
- bool operator==(const FileFixifyCacheKey &f) const
- {
- return (f.canonicalize == canonicalize &&
- f.fixType == fixType &&
- f.file == file &&
- f.in_d == in_d &&
- f.out_d == out_d &&
- f.pwd == pwd);
- }
- inline uint hashCode() const {
- if(!hash)
- hash = uint(canonicalize) | uint(fixType) |
- qHash(file) | qHash(in_d) | qHash(out_d) /*|qHash(pwd)*/;
- return hash;
- }
-};
-
-inline uint qHash(const FileFixifyCacheKey &f) { return f.hashCode(); }
-// -------------------------------------------------------------------------------------------------
-
template <typename T>
inline void qmakeDeleteCacheClear(void *i) { delete reinterpret_cast<T*>(i); }
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 595768f..9e2be31 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1485,18 +1485,20 @@ MakefileGenerator::createObjectList(const QStringList &sources)
ReplaceExtraCompilerCacheKey::ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o)
{
+ static QString doubleColon = QLatin1String("::");
+
hash = 0;
pwd = qmake_getpwd();
var = v;
{
QStringList il = i;
il.sort();
- in = il.join("::");
+ in = il.join(doubleColon);
}
{
QStringList ol = o;
ol.sort();
- out = ol.join("::");
+ out = ol.join(doubleColon);
}
}
@@ -2813,17 +2815,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
return file;
QString ret = unescapeFilePath(file);
- //setup the cache
- static QHash<FileFixifyCacheKey, QString> *cache = 0;
- if(!cache) {
- cache = new QHash<FileFixifyCacheKey, QString>;
- qmakeAddCacheClear(qmakeDeleteCacheClear<QHash<FileFixifyCacheKey, QString> >, (void**)&cache);
- }
- FileFixifyCacheKey cacheKey(ret, out_d, in_d, fix, canon);
- QString cacheVal = cache->value(cacheKey);
- if(!cacheVal.isNull())
- return cacheVal;
-
//do the fixin'
QString pwd = qmake_getpwd();
if (!pwd.endsWith('/'))
@@ -2908,7 +2899,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s] [%s::%s]", fix, canon, orig_file.toLatin1().constData(),
ret.toLatin1().constData(), in_d.toLatin1().constData(), out_d.toLatin1().constData(),
pwd.toLatin1().constData(), Option::output_dir.toLatin1().constData());
- cache->insert(cacheKey, ret);
return ret;
}
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index 9fd5fa9..d4d2400 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -1670,21 +1670,21 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
for (int i = 0; i < project.SingleProjects.count(); ++i) {
VCFilter filter;
const VCProjectSingleConfig &singleCfg = project.SingleProjects.at(i);
- if (filtername == "Root Files") {
+ if (filtername.startsWith("Root Files")) {
filter = singleCfg.RootFiles;
- } else if (filtername == "Source Files") {
+ } else if (filtername.startsWith("Source Files")) {
filter = singleCfg.SourceFiles;
- } else if (filtername == "Header Files") {
+ } else if (filtername.startsWith("Header Files")) {
filter = singleCfg.HeaderFiles;
- } else if (filtername == "Generated Files") {
+ } else if (filtername.startsWith("Generated Files")) {
filter = singleCfg.GeneratedFiles;
- } else if (filtername == "LexYacc Files") {
+ } else if (filtername.startsWith("LexYacc Files")) {
filter = singleCfg.LexYaccFiles;
- } else if (filtername == "Translation Files") {
+ } else if (filtername.startsWith("Translation Files")) {
filter = singleCfg.TranslationFiles;
- } else if (filtername == "Form Files") {
+ } else if (filtername.startsWith("Form Files")) {
filter = singleCfg.FormFiles;
- } else if (filtername == "Resource Files") {
+ } else if (filtername.startsWith("Resource Files")) {
filter = singleCfg.ResourceFiles;
} else {
// ExtraCompilers
@@ -1698,7 +1698,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
if ( !fileAdded )
{
- if (filtername == "Source Files") {
+ if (filtername.startsWith("Source Files")) {
xmlFilter << tag("ClCompile")
<< attrTag("Include",Option::fixPathToLocalOS(info.file))
@@ -1707,7 +1707,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
xml << tag("ClCompile")
<< attrTag("Include",Option::fixPathToLocalOS(info.file));
- } else if(filtername == "Header Files") {
+ } else if(filtername.startsWith("Header Files")) {
xmlFilter << tag("ClInclude")
<< attrTag("Include",Option::fixPathToLocalOS(info.file))
@@ -1715,7 +1715,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
xml << tag("ClInclude")
<< attrTag("Include",Option::fixPathToLocalOS(info.file));
- } else if(filtername == "Generated Files" || filtername == "Form Files") {
+ } else if(filtername.startsWith("Generated Files") || filtername.startsWith("Form Files")) {
if (info.file.endsWith(".h")) {
@@ -1751,7 +1751,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
<< attrTag("Include",Option::fixPathToLocalOS(info.file));
}
- } else if(filtername == "Root Files") {
+ } else if(filtername.startsWith("Root Files")) {
if (info.file.endsWith(".rc")) {
@@ -1831,7 +1831,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut
xml << tag("CustomBuild")
<< attrTag("Include",Option::fixPathToLocalOS(filename));
- if ( filtername == "Form Files" || filtername == "Generated Files" || filtername == "Resource Files" )
+ if ( filtername.startsWith("Form Files") || filtername.startsWith("Generated Files") || filtername.startsWith("Resource Files") )
xml << attrTagS("FileType", "Document");
}
@@ -1842,7 +1842,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut
{
fileAdded = true;
- if (filtername == "Source Files") {
+ if (filtername.startsWith("Source Files")) {
xmlFilter << tag("ClCompile")
<< attrTag("Include",Option::fixPathToLocalOS(filename))
@@ -1851,7 +1851,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut
xml << tag("ClCompile")
<< attrTag("Include",Option::fixPathToLocalOS(filename));
- } else if(filtername == "Header Files") {
+ } else if(filtername.startsWith("Header Files")) {
xmlFilter << tag("ClInclude")
<< attrTag("Include",Option::fixPathToLocalOS(filename))
@@ -1859,7 +1859,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut
xml << tag("ClInclude")
<< attrTag("Include",Option::fixPathToLocalOS(filename));
- } else if(filtername == "Generated Files" || filtername == "Form Files") {
+ } else if(filtername.startsWith("Generated Files") || filtername.startsWith("Form Files")) {
if (filename.endsWith(".h")) {
@@ -1894,7 +1894,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut
xml << tag("CustomBuild")
<< attrTag("Include",Option::fixPathToLocalOS(filename));
}
- } else if(filtername == "Root Files") {
+ } else if(filtername.startsWith("Root Files")) {
if (filename.endsWith(".rc")) {
diff --git a/qmake/option.cpp b/qmake/option.cpp
index c1b43e8..dd28336 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -630,16 +630,18 @@ Option::fixString(QString string, uchar flags)
qmakeAddCacheClear(qmakeDeleteCacheClear<QHash<FixStringCacheKey, QString> >, (void**)&cache);
}
FixStringCacheKey cacheKey(string, flags);
- if(cache->contains(cacheKey)) {
- const QString ret = cache->value(cacheKey);
- //qDebug() << "Fix (cached) " << orig_string << "->" << ret;
- return ret;
+
+ QHash<FixStringCacheKey, QString>::const_iterator it = cache->constFind(cacheKey);
+
+ if (it != cache->constEnd()) {
+ //qDebug() << "Fix (cached) " << orig_string << "->" << it.value();
+ return it.value();
}
//fix the environment variables
if(flags & Option::FixEnvVars) {
int rep;
- QRegExp reg_var("\\$\\(.*\\)");
+ static QRegExp reg_var("\\$\\(.*\\)");
reg_var.setMinimal(true);
while((rep = reg_var.indexIn(string)) != -1)
string.replace(rep, reg_var.matchedLength(),