diff options
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/doc/qmake.qdocconf | 2 | ||||
-rw-r--r-- | qmake/doc/src/qmake-manual.qdoc | 78 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 14 | ||||
-rw-r--r-- | qmake/generators/projectgenerator.cpp | 10 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.cpp | 23 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 24 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 95 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.h | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 39 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.h | 5 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 4 | ||||
-rw-r--r-- | qmake/library/qmakeevaluator.cpp | 2 | ||||
-rw-r--r-- | qmake/property.cpp | 14 |
14 files changed, 183 insertions, 131 deletions
diff --git a/qmake/doc/qmake.qdocconf b/qmake/doc/qmake.qdocconf index 3493a697f4..cf8f911372 100644 --- a/qmake/doc/qmake.qdocconf +++ b/qmake/doc/qmake.qdocconf @@ -25,6 +25,8 @@ sources = src/qmake-manual.qdoc imagedirs = images exampledirs = snippets +tagfile = qmake.tags + depends += \ activeqt \ qt3d \ diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index d3148a1e62..b271abcee3 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -974,6 +974,12 @@ the compiler does not support C++17, or can't select the C++ standard. By default, support is disabled. \row \li c++17 \li Same as c++1z. + \row \li c++2a \li C++2a support is enabled. This option has no effect if + the compiler does not support C++2a, or can't select the C++ standard. + By default, support is disabled. + \row \li c++latest \li Support for the latest C++ language standard is + enabled that is supported by the compiler. By default, this option is + disabled. \row \li strict_c++ \li Disables support for C++ compiler extensions. By default, they are enabled. \row \li depend_includepath \li Appending the value of INCLUDEPATH to @@ -1148,8 +1154,9 @@ \target DEPENDPATH \section1 DEPENDPATH - Specifies a list of all directories to look in to resolve dependencies. This - variable is used when crawling through \c included files. + Specifies a list of directories for qmake to scan, to resolve dependencies. + This variable is used when qmake crawls through the header files that you + \c{#include} in your source code. \target DESTDIR \section1 DESTDIR @@ -1277,6 +1284,41 @@ \snippet code/doc_src_qmake-manual.pro 36 + \c INSTALLS has a \c{.CONFIG} member that can take several values: + + \table + \header + \li Value + \li Description + \row + \li no_check_exists + \li If not set, qmake looks to see if the files to install actually + exist. If these files don't exist, qmake doesn’t create the + install rule. Use this config value if you need to install + files that are generated as part of your build process, like + HTML files created by qdoc. + \row + \li nostrip + \li If set, the typical Unix strip functionality is turned off and + the debug information will remain in the binary. + \row + \li executable + \li On Unix, this sets the executable flag. + \row + \li no_build + \li When you do a \c{make install}, and you don't have a build of + the project yet, the project is first built, and then installed. + If you don't want this behavior, set this config value to ensure + that the build target is not added as a dependency to the install + target. + \row + \li no_default_install + \li A project has a top-level project target where, when you do a + \c{make install}, everything is installed. But, if you have an + install target with this config value set, it's not installed by + default. You then have to explicitly say \c{make install_<file>}. + \endtable + For more information, see \l{Installing Files}. This variable is also used to specify which additional files will be @@ -2820,6 +2862,26 @@ See also \l{#DEPENDPATH}{DEPENDPATH}. + \target WINDOWS_TARGET_PLATFORM_VERSION + \section1 WINDOWS_TARGET_PLATFORM_VERSION + + Specifies the targeted Windows version; this corresponds to the tag + \c{WindowsTargetPlatformVersion} in vcxproj files. + + On desktop Windows, the default value is the value of the environment + variable \c{WindowsSDKVersion}. + + On WinRT, the default value is the value of the environment variable + \c{UCRTVERSION}. + + \target WINDOWS_TARGET_PLATFORM_MIN_VERSION + \section1 WINDOWS_TARGET_PLATFORM_MIN_VERSION + + Specifies the minimum version of the Windows target platform; this + corresponds to the tag \c{WindowsTargetPlatformMinVersion} in vcxproj files. + + Defaults to \c{WINDOWS_TARGET_PLATFORM_VERSION}. + \target WINRT_MANIFEST \section1 WINRT_MANIFEST @@ -2953,10 +3015,12 @@ \li The version number of the package. Defaults to \c{1.0.0.0}. \row \li minVersion - \li The minimum required Windows version to run the package. Defaults to the environment variable \c UCRTVersion. + \li The minimum required Windows version to run the package. + Defaults to \c{WINDOWS_TARGET_PLATFORM_VERSION}. \row \li maxVersionTested - \li The maximum Windows version the package has been tested against. Defaults to \c WINRT_MANIFEST.minVersion + \li The maximum Windows version the package has been tested against. + Defaults to \c{WINDOWS_TARGET_PLATFORM_MIN_VERSION}. \endtable @@ -4514,7 +4578,10 @@ \c QMAKEFEATURES environment variable) \li \c $$QMAKEFEATURES/myfeatures.prf (for each directory listed in the \c QMAKEFEATURES property variable) - \li \c myfeatures.prf (in the project's root directory) + \li \c myfeatures.prf (in the project's root directory). The project root + is determined by the top-level \c{.pro} file. However, if you place the + \c{.qmake.cache} file in a sub-directory or the directory of a + sub-project, then the project root becomes the sub-directory itself. \li \c $QMAKEPATH/mkspecs/features/unix/myfeatures.prf and \c $QMAKEPATH/mkspecs/features/myfeatures.prf (for each directory listed in the \c QMAKEPATH environment variable) @@ -4819,6 +4886,7 @@ \li Unix \list \li GCC 3.4 and above + \li clang \endlist \endlist diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index d53dbf9fa5..8ca4d68700 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -627,7 +627,7 @@ MakefileGenerator::init() compiler.flags |= Compiler::CompilerNoCheckDeps; compilers.append(compiler); } - for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { + for (ProStringList::ConstIterator it = quc.cbegin(); it != quc.cend(); ++it) { const ProStringList &inputs = v[ProKey(*it + ".input")]; for(x = 0; x < inputs.size(); ++x) { Compiler compiler; @@ -1910,7 +1910,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell), FileFixifyFromOutdir)); } else { - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { t << ' ' << escapeDependencyPath(fileFixify( replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell), FileFixifyFromOutdir)); @@ -1945,7 +1945,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) const QString del_statement("-$(DEL_FILE)"); if(!wrote_clean) { QStringList dels; - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString tinp = (*input).toQString(); QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell); for (const QString &rc : qAsConst(raw_clean)) { @@ -1974,7 +1974,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if(!cleans.isEmpty()) t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, ""); if(!wrote_clean_cmds) { - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString tinp = (*input).toQString(); t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, tinp, replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell); @@ -1993,7 +1993,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QStringList deps, inputs; if(!tmp_dep.isEmpty()) deps += fileFixify(tmp_dep, FileFixifyFromOutdir); - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString inpf = (*input).toQString(); deps += findDependencies(inpf); inputs += Option::fixPathToTargetOS(inpf, false); @@ -2065,7 +2065,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) t << "\n\t" << cmd << endl << endl; continue; } - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString inpf = (*input).toQString(); QStringList deps; deps << fileFixify(inpf, FileFixifyFromOutdir); @@ -3385,7 +3385,7 @@ MakefileGenerator::writePkgConfigFile() libs << "QMAKE_LIBS_PRIVATE"; libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? t << "Libs.private:"; - for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) + for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) t << ' ' << fixLibFlags((*it).toKey()).join(' '); t << endl; } diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp index f45a90b851..ef34955eb1 100644 --- a/qmake/generators/projectgenerator.cpp +++ b/qmake/generators/projectgenerator.cpp @@ -345,14 +345,10 @@ ProjectGenerator::writeMakefile(QTextStream &t) << getWritableVar("CONFIG_REMOVE", false) << getWritableVar("INCLUDEPATH") << endl; - t << "# The following define makes your compiler warn you if you use any\n" - "# feature of Qt which has been marked as deprecated (the exact warnings\n" - "# depend on your compiler). Please consult the documentation of the\n" - "# deprecated API in order to know how to port your code away from it.\n" - "DEFINES += QT_DEPRECATED_WARNINGS\n" - "\n" - "# You can also make your code fail to compile if you use deprecated APIs.\n" + t << "# You can make your code fail to compile if you use deprecated APIs.\n" "# In order to do so, uncomment the following line.\n" + "# Please consult the documentation of the deprecated API in order to know\n" + "# how to port your code away from it.\n" "# You can also select to disable deprecated APIs only up to a certain version of Qt.\n" "#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0\n\n"; diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 24215ae7b0..7d8c70ec3b 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1487,7 +1487,7 @@ UnixMakefileGenerator::writeLibtoolFile() ProStringList libs; libs << "LIBS" << "QMAKE_LIBS"; t << "dependency_libs='"; - for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) + for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) t << fixLibFlags((*it).toKey()).join(' ') << ' '; t << "'\n\n"; diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 87cd560552..08a8c2168d 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -34,7 +34,6 @@ #include <qscopedpointer.h> #include <qstringlist.h> #include <qfileinfo.h> -#include <qversionnumber.h> QT_BEGIN_NAMESPACE @@ -626,31 +625,17 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << tagValue("RootNamespace", tool.Name) << tagValue("Keyword", tool.Keyword); - QString windowsTargetPlatformVersion; if (isWinRT) { xml << tagValue("MinimumVisualStudioVersion", tool.Version) << tagValue("DefaultLanguage", "en") << tagValue("AppContainerApplication", "true") << tagValue("ApplicationType", "Windows Store") << tagValue("ApplicationTypeRevision", tool.SdkVersion); - if (tool.SdkVersion == "10.0") - windowsTargetPlatformVersion = qgetenv("UCRTVERSION"); - } else { - QByteArray winSDKVersionStr = qgetenv("WindowsSDKVersion").trimmed(); - - // This environment variable might end with a backslash due to a VS bug. - if (winSDKVersionStr.endsWith('\\')) - winSDKVersionStr.chop(1); - - QVersionNumber winSDKVersion = QVersionNumber::fromString( - QString::fromLocal8Bit(winSDKVersionStr)); - if (!winSDKVersion.isNull()) - windowsTargetPlatformVersion = winSDKVersionStr; - } - if (!windowsTargetPlatformVersion.isEmpty()) { - xml << tagValue("WindowsTargetPlatformVersion", windowsTargetPlatformVersion) - << tagValue("WindowsTargetPlatformMinVersion", windowsTargetPlatformVersion); } + if (!tool.WindowsTargetPlatformVersion.isEmpty()) + xml << tagValue("WindowsTargetPlatformVersion", tool.WindowsTargetPlatformVersion); + if (!tool.WindowsTargetPlatformMinVersion.isEmpty()) + xml << tagValue("WindowsTargetPlatformMinVersion", tool.WindowsTargetPlatformMinVersion); xml << closetag(); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index f295705e2e..63d89a5388 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -165,21 +165,17 @@ QString NmakeMakefileGenerator::var(const ProKey &value) const || value == "QMAKE_RUN_CXX_IMP" || value == "QMAKE_RUN_CXX"); if ((isRunCpp && usePCH) || (isRunC && usePCHC)) { - QFileInfo precompHInfo(fileInfo(precompH)); - QString precompH_f = escapeFilePath(precompHInfo.fileName()); + QString precompH_f = escapeFilePath(fileFixify(precompH, FileFixifyBackwards)); QString precompRule = QString("-c -FI%1 -Yu%2 -Fp%3") .arg(precompH_f, precompH_f, escapeFilePath(isRunC ? precompPchC : precompPch)); + // ### For clang_cl 8 we force inline methods to be compiled here instead + // linking them from a pch.o file. We do this by pretending we are also doing + // the pch.o generation step. + if (project->isActiveConfig("clang_cl")) + precompRule += QString(" -Xclang -building-pch-with-obj"); QString p = MakefileGenerator::var(value); p.replace(QLatin1String("-c"), precompRule); - // Cannot use -Gm with -FI & -Yu, as this gives an - // internal compiler error, on the newer compilers - // ### work-around for a VS 2003 bug. Move to some prf file or remove completely. - p.remove("-Gm"); return p; - } else if (value == "QMAKE_CXXFLAGS") { - // Remove internal compiler error option - // ### work-around for a VS 2003 bug. Move to some prf file or remove completely. - return MakefileGenerator::var(value).remove("-Gm"); } } @@ -238,7 +234,10 @@ void NmakeMakefileGenerator::init() precompObj = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch" + Option::obj_ext; precompPch = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch.pch"; // Add linking of precompObj (required for whole precompiled classes) - project->values("OBJECTS") += precompObj; + // ### For clang_cl we currently let inline methods be generated in the normal objects, + // since the PCH object is buggy (as of clang 8.0.0) + if (!project->isActiveConfig("clang_cl")) + project->values("OBJECTS") += precompObj; // Add pch file to cleanup project->values("QMAKE_CLEAN") += precompPch; // Return to variable pool @@ -248,7 +247,8 @@ void NmakeMakefileGenerator::init() if (usePCHC) { precompObjC = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch_c" + Option::obj_ext; precompPchC = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch_c.pch"; - project->values("OBJECTS") += precompObjC; + if (!project->isActiveConfig("clang_cl")) + project->values("OBJECTS") += precompObjC; project->values("QMAKE_CLEAN") += precompPchC; project->values("PRECOMPILED_OBJECT_C") = ProStringList(precompObjC); project->values("PRECOMPILED_PCH_C") = ProStringList(precompPchC); diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index f08554d0f5..15c8838054 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2222,8 +2222,49 @@ void VCFilter::addFiles(const ProStringList& fileList) void VCFilter::modifyPCHstage(QString str) { - bool autogenSourceFile = Project->autogenPrecompCPP; - bool pchThroughSourceFile = !Project->precompCPP.isEmpty(); + const bool isHFile = (str == Project->precompH); + const bool pchThroughSourceFile = !Project->precompSource.isEmpty(); + if (isHFile && pchThroughSourceFile && Project->autogenPrecompSource) { + useCustomBuildTool = true; + QString toFile(Project->precompSource); + CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ..."; + CustomBuildTool.Outputs += toFile; + + QStringList lines; + CustomBuildTool.CommandLine += + "echo /*-------------------------------------------------------------------- >" + toFile; + lines << "* Precompiled header source file used by Visual Studio.NET to generate"; + lines << "* the .pch file."; + lines << "*"; + lines << "* Due to issues with the dependencies checker within the IDE, it"; + lines << "* sometimes fails to recompile the PCH file, if we force the IDE to"; + lines << "* create the PCH file directly from the header file."; + lines << "*"; + lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was"; + lines << "* specified, and is used as the common stdafx.cpp. The file is only"; + lines << QLatin1String("* generated when creating ") + + (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj") + + " project files, and is not used for"; + lines << "* command line compilations by nmake."; + lines << "*"; + lines << "* WARNING: All changes made in this file will be lost."; + lines << "--------------------------------------------------------------------*/"; + lines << "#include \"" + Project->precompHFilename + "\""; + for (const QString &line : qAsConst(lines)) + CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile; + return; + } + + useCompilerTool = true; + const bool isPrecompSource = pchThroughSourceFile && (str == Project->precompSource); + if (isPrecompSource) { + CompilerTool.UsePrecompiledHeader = pchCreateUsingSpecific; + if (Project->autogenPrecompSource) + CompilerTool.PrecompiledHeaderThrough = Project->precompHFilename; + CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); + return; + } + bool isCFile = false; for (QStringList::Iterator it = Option::c_ext.begin(); it != Option::c_ext.end(); ++it) { if (str.endsWith(*it)) { @@ -2231,53 +2272,13 @@ void VCFilter::modifyPCHstage(QString str) break; } } - const bool isHFile = (str == Project->precompH); - bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP); - - if(!isCFile && !isHFile && !isCPPFile) - return; - - if(isHFile && pchThroughSourceFile) { - if (autogenSourceFile) { - useCustomBuildTool = true; - QString toFile(Project->precompCPP); - CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ..."; - CustomBuildTool.Outputs += toFile; - - QStringList lines; - CustomBuildTool.CommandLine += - "echo /*-------------------------------------------------------------------- >" + toFile; - lines << "* Precompiled header source file used by Visual Studio.NET to generate"; - lines << "* the .pch file."; - lines << "*"; - lines << "* Due to issues with the dependencies checker within the IDE, it"; - lines << "* sometimes fails to recompile the PCH file, if we force the IDE to"; - lines << "* create the PCH file directly from the header file."; - lines << "*"; - lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was"; - lines << "* specified, and is used as the common stdafx.cpp. The file is only"; - lines << QLatin1String("* generated when creating ") - + (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj") - + " project files, and is not used for"; - lines << "* command line compilations by nmake."; - lines << "*"; - lines << "* WARNING: All changes made in this file will be lost."; - lines << "--------------------------------------------------------------------*/"; - lines << "#include \"" + Project->precompHFilename + "\""; - for (const QString &line : qAsConst(lines)) - CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile; - } - return; - } - useCompilerTool = true; - // Setup PCH options - CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific); - if (isCFile) + bool pchCompatible = (isCFile == Project->pchIsCFile); + if (!pchCompatible) { + CompilerTool.UsePrecompiledHeader = pchNone; CompilerTool.PrecompiledHeaderThrough = QLatin1String("$(NOINHERIT)"); - else if (autogenSourceFile) - CompilerTool.PrecompiledHeaderThrough = Project->precompHFilename; - CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); + CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); + } } VCFilterFile VCFilter::findFile(const QString &filePath, bool *found) const diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index f6d1fc8023..b356f1bb73 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -1125,6 +1125,8 @@ public: QString SccLocalPath; QString PlatformName; QString SdkVersion; + QString WindowsTargetPlatformVersion; + QString WindowsTargetPlatformMinVersion; // Single projects QList<VCProjectSingleConfig> SingleProjects; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index be0b67a9e6..fd53ec2a6e 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -193,6 +193,10 @@ bool VcprojGenerator::writeProjectMakefile() mergedProject.SccProjectName = mergedProjects.at(0)->vcProject.SccProjectName; mergedProject.SccLocalPath = mergedProjects.at(0)->vcProject.SccLocalPath; mergedProject.PlatformName = mergedProjects.at(0)->vcProject.PlatformName; + mergedProject.WindowsTargetPlatformVersion = + project->first("WINDOWS_TARGET_PLATFORM_VERSION").toQString(); + mergedProject.WindowsTargetPlatformMinVersion = + project->first("WINDOWS_TARGET_PLATFORM_MIN_VERSION").toQString(); XmlOutput xmlOut(t); projectWriter->write(xmlOut, mergedProject); @@ -477,8 +481,8 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt // Add all unknown libs to the deps QStringList where = QStringList() << "LIBS" << "LIBS_PRIVATE" << "QMAKE_LIBS" << "QMAKE_LIBS_PRIVATE"; - for (QStringList::ConstIterator wit = where.begin(); - wit != where.end(); ++wit) { + for (QStringList::ConstIterator wit = where.cbegin(); + wit != where.cend(); ++wit) { const ProStringList &l = tmp_proj.values(ProKey(*wit)); for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { const QString opt = fixLibFlag(*it).toQString(); @@ -778,8 +782,9 @@ void VcprojGenerator::init() // Setup PCH variables precompH = project->first("PRECOMPILED_HEADER").toQString(); - precompCPP = project->first("PRECOMPILED_SOURCE").toQString(); - usePCH = !precompH.isEmpty() && project->isActiveConfig("precompile_header"); + precompSource = project->first("PRECOMPILED_SOURCE").toQString(); + pchIsCFile = project->isActiveConfig("precompile_header_c"); + usePCH = !precompH.isEmpty() && (pchIsCFile || project->isActiveConfig("precompile_header")); if (usePCH) { precompHFilename = fileInfo(precompH).fileName(); // Created files @@ -793,13 +798,15 @@ void VcprojGenerator::init() project->values("PRECOMPILED_OBJECT") = ProStringList(precompObj); project->values("PRECOMPILED_PCH") = ProStringList(precompPch); - autogenPrecompCPP = precompCPP.isEmpty() && project->isActiveConfig("autogen_precompile_source"); - if (autogenPrecompCPP) { - precompCPP = precompH - + (Option::cpp_ext.count() ? Option::cpp_ext.at(0) : QLatin1String(".cpp")); - project->values("GENERATED_SOURCES") += precompCPP; - } else if (!precompCPP.isEmpty()) { - project->values("SOURCES") += precompCPP; + autogenPrecompSource = precompSource.isEmpty() && project->isActiveConfig("autogen_precompile_source"); + if (autogenPrecompSource) { + precompSource = precompH + + (pchIsCFile + ? (Option::c_ext.count() ? Option::c_ext.at(0) : QLatin1String(".c")) + : (Option::cpp_ext.count() ? Option::cpp_ext.at(0) : QLatin1String(".cpp"))); + project->values("GENERATED_SOURCES") += precompSource; + } else if (!precompSource.isEmpty()) { + project->values("SOURCES") += precompSource; } } @@ -1056,16 +1063,6 @@ void VcprojGenerator::initCompilerTool() conf.compiler.PrecompiledHeaderFile = "$(IntDir)\\" + precompPch; conf.compiler.PrecompiledHeaderThrough = project->first("PRECOMPILED_HEADER").toQString(); conf.compiler.ForcedIncludeFiles = project->values("PRECOMPILED_HEADER").toQStringList(); - - if (conf.CompilerVersion <= NET2003) { - // Minimal build option triggers an Internal Compiler Error - // when used in conjunction with /FI and /Yu, so remove it - // ### work-around for a VS 2003 bug. Move to some prf file or remove completely. - project->values("QMAKE_CFLAGS_DEBUG").removeAll("-Gm"); - project->values("QMAKE_CFLAGS_DEBUG").removeAll("/Gm"); - project->values("QMAKE_CXXFLAGS_DEBUG").removeAll("-Gm"); - project->values("QMAKE_CXXFLAGS_DEBUG").removeAll("/Gm"); - } } conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS")); diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 0b9770e962..55d36c3762 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -57,15 +57,16 @@ public: ~VcprojGenerator(); QString defaultMakefile() const; - QString precompH, precompHFilename, precompCPP, + QString precompH, precompHFilename, precompSource, precompObj, precompPch; - bool autogenPrecompCPP; + bool autogenPrecompSource; static bool hasBuiltinCompiler(const QString &file); QHash<QString, QStringList> extraCompilerSources; QHash<QString, QString> extraCompilerOutputs; const QString customBuildToolFilterFileSuffix; bool usePCH; + bool pchIsCFile = false; VCProjectWriter *projectWriter; protected: diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 208af1327f..16f9361d13 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -116,8 +116,8 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) goto found; } QString libBase = (*dir_it).local() + '/' + lib + verovr; - for (ProStringList::ConstIterator extit = impexts.begin(); - extit != impexts.end(); ++extit) { + for (ProStringList::ConstIterator extit = impexts.cbegin(); + extit != impexts.cend(); ++extit) { if (exists(libBase + '.' + *extit)) { (*it) = cand + verovr + '.' + *extit; goto found; diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 432339d48e..ade8e15a39 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1190,7 +1190,7 @@ bool QMakeEvaluator::loadSpecInternal() # ifdef Q_OS_UNIX if (m_qmakespec.endsWith(QLatin1String("/default-host")) || m_qmakespec.endsWith(QLatin1String("/default"))) { - QString rspec = QFileInfo(m_qmakespec).readLink(); + QString rspec = QFileInfo(m_qmakespec).symLinkTarget(); if (!rspec.isEmpty()) m_qmakespec = QDir::cleanPath(QDir(m_qmakespec).absoluteFilePath(rspec)); } diff --git a/qmake/property.cpp b/qmake/property.cpp index c0a3ec0dab..432ff55664 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -178,8 +178,8 @@ QMakeProperty::exec() } return true; } - for(QStringList::ConstIterator it = Option::prop::properties.begin(); - it != Option::prop::properties.end(); it++) { + for (QStringList::ConstIterator it = Option::prop::properties.cbegin(); + it != Option::prop::properties.cend(); it++) { if(Option::prop::properties.count() > 1) fprintf(stdout, "%s:", (*it).toLatin1().constData()); const ProKey pkey(*it); @@ -191,11 +191,11 @@ QMakeProperty::exec() } } } else if(Option::qmake_mode == Option::QMAKE_SET_PROPERTY) { - for(QStringList::ConstIterator it = Option::prop::properties.begin(); - it != Option::prop::properties.end(); it++) { + for (QStringList::ConstIterator it = Option::prop::properties.cbegin(); + it != Option::prop::properties.cend(); it++) { QString var = (*it); it++; - if(it == Option::prop::properties.end()) { + if (it == Option::prop::properties.cend()) { ret = false; break; } @@ -203,8 +203,8 @@ QMakeProperty::exec() setValue(var, (*it)); } } else if(Option::qmake_mode == Option::QMAKE_UNSET_PROPERTY) { - for(QStringList::ConstIterator it = Option::prop::properties.begin(); - it != Option::prop::properties.end(); it++) { + for (QStringList::ConstIterator it = Option::prop::properties.cbegin(); + it != Option::prop::properties.cend(); it++) { QString var = (*it); if(!var.startsWith(".")) remove(var); |