diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2010-11-23 11:26:54 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2010-11-23 11:26:54 (GMT) |
commit | 802498fcd43558a10bb7477d3957cdd27fd8ec09 (patch) | |
tree | c40ddd859b032ffa7ed9c6df1173312c0bb1947d /qmake | |
parent | 901fee7e610ec53f744416aeeca89c4605923120 (diff) | |
parent | 538e7b8ddf45936bb274ed3230b591b3459edfa7 (diff) | |
download | Qt-802498fcd43558a10bb7477d3957cdd27fd8ec09.zip Qt-802498fcd43558a10bb7477d3957cdd27fd8ec09.tar.gz Qt-802498fcd43558a10bb7477d3957cdd27fd8ec09.tar.bz2 |
Merge remote branch 'qt/master' into file-engine-refactor
Conflicts:
demos/declarative/minehunt/minehunt.pro
src/corelib/io/io.pri
src/corelib/io/qfsfileengine.cpp
src/corelib/io/qfsfileengine_unix.cpp
src/corelib/io/qfsfileengine_win.cpp
src/s60installs/bwins/QtCoreu.def
src/s60installs/bwins/QtDeclarativeu.def
src/s60installs/bwins/QtGuiu.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/eabi/QtDeclarativeu.def
src/s60installs/eabi/QtGuiu.def
tests/auto/qapplication/test/test.pro
tests/auto/qaudioinput/qaudioinput.pro
tests/auto/qaudiooutput/qaudiooutput.pro
tests/auto/qchar/qchar.pro
tests/auto/qdiriterator/qdiriterator.pro
tests/auto/qsound/qsound.pro
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 1 | ||||
-rw-r--r-- | qmake/generators/metamakefile.cpp | 1 | ||||
-rw-r--r-- | qmake/generators/symbian/initprojectdeploy_symbian.cpp | 10 | ||||
-rw-r--r-- | qmake/generators/symbian/symbian_makefile.h | 4 | ||||
-rw-r--r-- | qmake/generators/symbian/symbiancommon.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_abld.cpp | 20 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_sbsv2.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 45 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 28 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 12 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 2 | ||||
-rw-r--r-- | qmake/project.cpp | 22 |
15 files changed, 121 insertions, 38 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index aa55f51..c659adb 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -167,6 +167,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) } if(tmp_proj.read(fn)) { if(Option::debug_level) { + debug_msg(1, "Dumping all variables:"); QMap<QString, QStringList> &vars = tmp_proj.variables(); for(QMap<QString, QStringList>::Iterator it = vars.begin(); it != vars.end(); ++it) { diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index e98831d..df05550 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -217,6 +217,7 @@ BuildsMetaMakefileGenerator::write(const QString &oldpwd) // debugging if(Option::debug_level) { + debug_msg(1, "Dumping all variables:"); QMap<QString, QStringList> &vars = project->variables(); for(QMap<QString, QStringList>::Iterator it = vars.begin(); it != vars.end(); ++it) { if(!it.key().startsWith(".") && !it.value().isEmpty()) diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 5a6f66f..eb45b10 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -59,7 +59,12 @@ static QString fixPathToEpocOS(const QString &src) { QString ret = Option::fixPathToTargetOS(src); - return ret.replace('/', '\\'); + + bool pathHasDriveLetter = false; + if (ret.size() > 1) + pathHasDriveLetter = (ret.at(1) == QLatin1Char(':')); + + return pathHasDriveLetter ? ret.replace('/', '\\') : QDir::toNativeSeparators(ret); } static bool isPlugin(const QFileInfo& info, const QString& devicePath) @@ -250,7 +255,8 @@ void initProjectDeploySymbian(QMakeProject* project, QStringList flags = project->values(item + ".flags"); - foreach(QString source, project->values(item + ".sources")) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + foreach(QString source, project->values(item + ".sources") + project->values(item + ".files")) { source = Option::fixPathToLocalOS(source); QString nameFilter; QFileInfo info(source); diff --git a/qmake/generators/symbian/symbian_makefile.h b/qmake/generators/symbian/symbian_makefile.h index 94f0145..63cede2 100644 --- a/qmake/generators/symbian/symbian_makefile.h +++ b/qmake/generators/symbian/symbian_makefile.h @@ -72,7 +72,9 @@ public: } else { const QStringList deployments = this->project->values("DEPLOYMENT"); for (int i = 0; i < deployments.count(); ++i) { - if (!this->project->values(deployments.at(i) + ".sources").isEmpty()) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + if (!this->project->values(deployments.at(i) + ".sources").isEmpty() || + !this->project->values(deployments.at(i) + ".files").isEmpty()) { generatePkg = true; break; } diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 0938b58..9d4f27e 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -699,7 +699,7 @@ void SymbianCommonGenerator::readRssRules(QString &numberOfIcons, newValues << itemList.join("\n"); } } - // Verify thet there is exactly one value in RSS_TAG_NBROFICONS + // Verify that there is exactly one value in RSS_TAG_NBROFICONS if (newKey == RSS_TAG_NBROFICONS) { if (newValues.count() == 1) { numberOfIcons = newValues[0]; @@ -708,7 +708,7 @@ void SymbianCommonGenerator::readRssRules(QString &numberOfIcons, RSS_RULES_BASE, RSS_TAG_NBROFICONS); continue; } - // Verify thet there is exactly one value in RSS_TAG_ICONFILE + // Verify that there is exactly one value in RSS_TAG_ICONFILE } else if (newKey == RSS_TAG_ICONFILE) { if (newValues.count() == 1) { iconFile = newValues[0]; diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 09a3fc8..0d63cdf 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -197,7 +197,9 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) generatePkg = true; } else { foreach(QString item, project->values("DEPLOYMENT")) { - if (!project->values(item + ".sources").isEmpty()) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + if (!project->values(item + ".sources").isEmpty() || + !project->values(item + ".files").isEmpty()) { generatePkg = true; break; } diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index 7416cbe..f895109 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -205,8 +205,11 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool #ifdef Q_OS_WIN32 t << "XCOPY = xcopy /d /f /h /r /y /i" << endl; t << "ABLD = ABLD.BAT" << endl; +#elif defined(Q_OS_MAC) + t << "XCOPY = cp -R -v" << endl; + t << "ABLD = abld" << endl; #else - t << "XCOPY = cp -u -v" << endl; + t << "XCOPY = cp -R -u -v" << endl; t << "ABLD = abld" << endl; #endif t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl; @@ -427,7 +430,8 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool i t << WINSCW_DEPLOYMENT_TARGET ":" << endl; QString remoteTestPath = epocRoot() - + QLatin1String(isRom ? "epoc32\\data\\z\\private\\" : "epoc32\\winscw\\c\\private\\") + + QDir::toNativeSeparators(QLatin1String(isRom ? "epoc32/data/z/private/" + : "epoc32/winscw/c/private/")) + privateDirUid; DeploymentList depList; @@ -439,11 +443,21 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool i t << "\t-echo Deploying changed files..." << endl; for (int i = 0; i < depList.size(); ++i) { +#ifdef Q_OS_WIN32 // Xcopy prompts for selecting file or directory if target doesn't exist, // and doesn't provide switch to force file selection. It does provide dir forcing, though, // so strip the last part of the destination. t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\") + 1) << "\"" << endl; +#else + QString dirExists = var("QMAKE_CHK_DIR_EXISTS"); + QString mkdir = var("QMAKE_MKDIR"); + QString dir = QFileInfo(depList.at(i).to).dir().path(); + t << "\t-@ " << dirExists << " \"" << dir << "\" || " + << mkdir << " \"" << dir << "\"" << endl; + t << "\t-$(XCOPY) \"" << QDir::toNativeSeparators(depList.at(i).from) << "\" \"" + << QDir::toNativeSeparators(depList.at(i).to) << "\"" << endl; +#endif } t << endl; @@ -455,7 +469,7 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool i QStringList cleanList; for (int i = 0; i < depList.size(); ++i) { - cleanList.append(depList.at(i).to); + cleanList.append(QDir::toNativeSeparators(depList.at(i).to)); } generateCleanCommands(t, cleanList, "$(DEL_FILE)", "", "", ""); diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 32c31ee..d650e08 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -120,7 +120,7 @@ void SymbianSbsv2MakefileGenerator::findInstalledCompilerVersions(const QString && fileInfo(matcher.cap(matcher.captureCount())).exists()) { // First capture (index 0) is the whole match, which is skipped. // Next n captures are version numbers, which are interesting. - // Final capture is the env var value, which we alrady used, so that is skipped, too. + // Final capture is the env var value, which we already used, so that is skipped, too. int capture = 1; int finalCapture = matcher.captureCount() - 1; QString version = versionPrefix; diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 71a6061..43543a1 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -206,6 +206,33 @@ UnixMakefileGenerator::init() // icc style pchFlags = pchFlags.replace("${QMAKE_PCH_OUTPUT}", pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT")); + } else { + // gcc style (including clang_pch_style) + QString headerPrefix = project->first("QMAKE_PRECOMP_PREFIX"); + QString headerSuffix; + if (project->isActiveConfig("clang_pch_style")) + headerSuffix = project->first("QMAKE_PCH_OUTPUT_EXT"); + else + pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT"); + + pchBaseName += Option::dir_sep; + QString pchOutputFile; + + if(comps[i] == "C") { + pchOutputFile = "c"; + } else if(comps[i] == "CXX") { + pchOutputFile = "c++"; + } else if(project->isActiveConfig("objective_c")) { + if(comps[i] == "OBJC") + pchOutputFile = "objective-c"; + else if(comps[i] == "OBJCXX") + pchOutputFile = "objective-c++"; + } + + if(!pchOutputFile.isEmpty()) { + pchFlags = pchFlags.replace("${QMAKE_PCH_OUTPUT}", + pchBaseName + pchOutputFile + headerSuffix); + } } if (!pchFlags.isEmpty()) @@ -379,7 +406,9 @@ QStringList QString header_prefix; if(!project->isEmpty("PRECOMPILED_DIR")) header_prefix = project->first("PRECOMPILED_DIR"); - header_prefix += project->first("QMAKE_ORIG_TARGET") + project->first("QMAKE_PCH_OUTPUT_EXT"); + header_prefix += project->first("QMAKE_ORIG_TARGET"); + if (!project->isActiveConfig("clang_pch_style")) + header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT"); if (project->isActiveConfig("icc_pch_style")) { // icc style for(QStringList::Iterator it = Option::cpp_ext.begin(); it != Option::cpp_ext.end(); ++it) { @@ -389,23 +418,25 @@ QStringList } } } else { - // gcc style + // gcc style (including clang_pch_style) + QString header_suffix = project->isActiveConfig("clang_pch_style") + ? project->first("QMAKE_PCH_OUTPUT_EXT") : ""; header_prefix += Option::dir_sep + project->first("QMAKE_PRECOMP_PREFIX"); for(QStringList::Iterator it = Option::c_ext.begin(); it != Option::c_ext.end(); ++it) { if(file.endsWith(*it)) { if(!project->isEmpty("QMAKE_CFLAGS_PRECOMPILE")) { - QString precomp_c_h = header_prefix + "c"; + QString precomp_c_h = header_prefix + "c" + header_suffix; if(!ret.contains(precomp_c_h)) ret += precomp_c_h; } if(project->isActiveConfig("objective_c")) { if(!project->isEmpty("QMAKE_OBJCFLAGS_PRECOMPILE")) { - QString precomp_objc_h = header_prefix + "objective-c"; + QString precomp_objc_h = header_prefix + "objective-c" + header_suffix; if(!ret.contains(precomp_objc_h)) ret += precomp_objc_h; } if(!project->isEmpty("QMAKE_OBJCXXFLAGS_PRECOMPILE")) { - QString precomp_objcpp_h = header_prefix + "objective-c++"; + QString precomp_objcpp_h = header_prefix + "objective-c++" + header_suffix; if(!ret.contains(precomp_objcpp_h)) ret += precomp_objcpp_h; } @@ -416,13 +447,13 @@ QStringList for(QStringList::Iterator it = Option::cpp_ext.begin(); it != Option::cpp_ext.end(); ++it) { if(file.endsWith(*it)) { if(!project->isEmpty("QMAKE_CXXFLAGS_PRECOMPILE")) { - QString precomp_cpp_h = header_prefix + "c++"; + QString precomp_cpp_h = header_prefix + "c++" + header_suffix; if(!ret.contains(precomp_cpp_h)) ret += precomp_cpp_h; } if(project->isActiveConfig("objective_c")) { if(!project->isEmpty("QMAKE_OBJCXXFLAGS_PRECOMPILE")) { - QString precomp_objcpp_h = header_prefix + "objective-c++"; + QString precomp_objcpp_h = header_prefix + "objective-c++" + header_suffix; if(!ret.contains(precomp_objcpp_h)) ret += precomp_objcpp_h; } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index d16cd6b..7c68316 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -835,7 +835,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isEmpty("PRECOMPILED_DIR")) precomph_out_dir = project->first("PRECOMPILED_DIR"); - precomph_out_dir += project->first("QMAKE_ORIG_TARGET") + project->first("QMAKE_PCH_OUTPUT_EXT"); + precomph_out_dir += project->first("QMAKE_ORIG_TARGET"); + if (!project->isActiveConfig("clang_pch_style")) + precomph_out_dir += project->first("QMAKE_PCH_OUTPUT_EXT"); if (project->isActiveConfig("icc_pch_style")) { // icc style @@ -849,19 +851,22 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) precomp_files << precomph_out_dir << sourceFile << objectFile; } else { - // gcc style + // gcc style (including clang_pch_style) precomph_out_dir += Option::dir_sep; QString header_prefix = project->first("QMAKE_PRECOMP_PREFIX"); + QString header_suffix = project->isActiveConfig("clang_pch_style") + ? project->first("QMAKE_PCH_OUTPUT_EXT") : ""; + if(!project->isEmpty("QMAKE_CFLAGS_PRECOMPILE")) - precomp_files += precomph_out_dir + header_prefix + "c"; + precomp_files += precomph_out_dir + header_prefix + "c" + header_suffix; if(!project->isEmpty("QMAKE_CXXFLAGS_PRECOMPILE")) - precomp_files += precomph_out_dir + header_prefix + "c++"; + precomp_files += precomph_out_dir + header_prefix + "c++" + header_suffix; if(project->isActiveConfig("objective_c")) { if(!project->isEmpty("QMAKE_OBJCFLAGS_PRECOMPILE")) - precomp_files += precomph_out_dir + header_prefix + "objective-c"; + precomp_files += precomph_out_dir + header_prefix + "objective-c" + header_suffix; if(!project->isEmpty("QMAKE_OBJCXXFLAGS_PRECOMPILE")) - precomp_files += precomph_out_dir + header_prefix + "objective-c++"; + precomp_files += precomph_out_dir + header_prefix + "objective-c++" + header_suffix; } } t << "-$(DEL_FILE) " << precomp_files.join(" ") << "\n\t"; @@ -930,7 +935,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString pchOutput; if(!project->isEmpty("PRECOMPILED_DIR")) pchOutput = project->first("PRECOMPILED_DIR"); - pchOutput += pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT"); + pchOutput += pchBaseName; + if (!project->isActiveConfig("clang_pch_style")) + pchOutput += project->first("QMAKE_PCH_OUTPUT_EXT"); if (project->isActiveConfig("icc_pch_style")) { // icc style @@ -943,9 +950,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) pchFlags = pchFlags.replace("${QMAKE_PCH_TEMP_SOURCE}", sourceFile) .replace("${QMAKE_PCH_TEMP_OBJECT}", objectFile); } else { - // gcc style + // gcc style (including clang_pch_style) QString header_prefix = project->first("QMAKE_PRECOMP_PREFIX"); - + QString header_suffix = project->isActiveConfig("clang_pch_style") + ? project->first("QMAKE_PCH_OUTPUT_EXT") : ""; pchOutput += Option::dir_sep; QString pchOutputDir = pchOutput, pchOutputFile; @@ -961,7 +969,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if(pchOutputFile.isEmpty()) continue; - pchOutput += header_prefix + pchOutputFile; + pchOutput += header_prefix + pchOutputFile + header_suffix; t << pchOutput << ": " << pchInput << " " << findDependencies(pchInput).join(" \\\n\t\t") << "\n\t" << mkdir_p_asstring(pchOutputDir); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index d32b888..0678d86 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -215,7 +215,7 @@ void NmakeMakefileGenerator::init() project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".exp"); } if(project->isActiveConfig("debug")) { - project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".pdb"); + project->values("QMAKE_DISTCLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".pdb"); project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".ilk"); project->values("QMAKE_CLEAN").append("vc*.pdb"); project->values("QMAKE_CLEAN").append("vc*.idb"); diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index b20d2b7..834e5fd 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2288,7 +2288,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) // Output in info.additionalFile ----------- if (!CustomBuildTool.Description.isEmpty()) - CustomBuildTool.Description += " & "; + CustomBuildTool.Description += ", "; CustomBuildTool.Description += cmd_name; CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed()); int space = cmd.indexOf(' '); diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 06b726f..fbaa6c2 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -459,6 +459,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) tmp_vcproj.setProjectFile(&tmp_proj); Option::qmake_mode = old_mode; if(Option::debug_level) { + debug_msg(1, "Dumping all variables:"); QMap<QString, QStringList> &vars = tmp_proj.variables(); for(QMap<QString, QStringList>::Iterator it = vars.begin(); it != vars.end(); ++it) { @@ -1174,7 +1175,8 @@ void VcprojGenerator::initDeploymentTool() devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath)); } // foreach d in item.sources - foreach(QString source, project->values(item + ".sources")) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + foreach(QString source, project->values(item + ".sources") + project->values(item + ".files")) { QString itemDevicePath = devicePath; source = Option::fixPathToLocalOS(source); QString nameFilter; @@ -1551,10 +1553,10 @@ QString VcprojGenerator::fixFilename(QString ofile) const if(slashfind == -1) { ofile = ofile.replace('-', '_'); } else { - int hypenfind = ofile.indexOf('-', slashfind); - while (hypenfind != -1 && slashfind < hypenfind) { - ofile = ofile.replace(hypenfind, 1, '_'); - hypenfind = ofile.indexOf('-', hypenfind + 1); + int hyphenfind = ofile.indexOf('-', slashfind); + while (hyphenfind != -1 && slashfind < hyphenfind) { + ofile = ofile.replace(hyphenfind, 1, '_'); + hyphenfind = ofile.indexOf('-', hyphenfind + 1); } } return ofile; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 58f21cb..ddfe399 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -651,7 +651,7 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) t << "DIST = " << varList("DISTFILES") << endl; t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl; - // The comment is important to maintain variable compatability with Unix + // The comment is important to maintain variable compatibility with Unix // Makefiles, while not interpreting a trailing-slash as a linebreak t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak" << endl; t << "TARGET = " << escapeFilePath(target) << endl; diff --git a/qmake/project.cpp b/qmake/project.cpp index 29d4242..5f5745a 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE -//expand fucntions +//expand functions enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST, E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION, E_FIND, E_SYSTEM, E_UNIQUE, E_QUOTE, E_ESCAPE_EXPAND, @@ -677,7 +677,23 @@ QMakeProject::reset() bool QMakeProject::parse(const QString &t, QMap<QString, QStringList> &place, int numLines) { - QString s = t.simplified(); + // To preserve the integrity of any UTF-8 characters in .pro file, temporarily replace the + // non-breaking space (0xA0) characters with another non-space character, so that + // QString::simplified() call will not replace it with space. + // Note: There won't be any two byte characters in .pro files, so 0x10A0 should be a safe + // replacement character. + static QChar nbsp(0xA0); + static QChar nbspFix(0x01A0); + QString s; + if (t.indexOf(nbsp) != -1) { + s = t; + s.replace(nbsp, nbspFix); + s = s.simplified(); + s.replace(nbspFix, nbsp); + } else { + s = t.simplified(); + } + int hash_mark = s.indexOf("#"); if(hash_mark != -1) //good bye comments s = s.left(hash_mark); @@ -1063,7 +1079,7 @@ QMakeProject::parse(const QString &t, QMap<QString, QStringList> &place, int num #undef SKIP_WS doVariableReplace(var, place); - var = varMap(var); //backwards compatability + var = varMap(var); //backwards compatibility if(!var.isEmpty() && Option::mkfile::do_preprocess) { static QString last_file("*none*"); if(parser.file != last_file) { |