diff options
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/doc/snippets/code/doc_src_qmake-manual.pro | 6 | ||||
-rw-r--r-- | qmake/doc/src/qmake-manual.qdoc | 19 | ||||
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 23 | ||||
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.cpp | 7 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 25 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 3 |
8 files changed, 66 insertions, 27 deletions
diff --git a/qmake/doc/snippets/code/doc_src_qmake-manual.pro b/qmake/doc/snippets/code/doc_src_qmake-manual.pro index 7609a98111..6fa3ca085d 100644 --- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro +++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro @@ -977,3 +977,9 @@ VERSION_PE_HEADER = 1.2 RC_DEFINES += USE_MY_STUFF #! [186] +#! [187] +win32-g++:contains(QMAKE_HOST.arch, x86_64):{ + message("Host is 64bit") + ... +} +#! [187] diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 91f9040383..bc2b4a57e9 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -1714,6 +1714,25 @@ See \l{Creating Frameworks} for more information about creating frameworks. + \target QMAKE_HOST + \section1 QMAKE_HOST + + Provides information about the host machine running qmake. + For example, you can retrieve the host machine architecture from + \c{QMAKE_HOST.arch}. + + \table + \header \li Keys \li Values + \row \li .arch \li Host architecture + \row \li .os \li Host OS + \row \li .cpu_count \li Number of available cpus + \row \li .name \li Host computer name + \row \li .version \li Host OS version number + \row \li .version_string \li Host OS version string + \endtable + + \snippet code/doc_src_qmake-manual.pro 187 + \target QMAKE_INCDIR \section1 QMAKE_INCDIR diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 81bb0683ac..7ff1d97b16 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1478,7 +1478,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) else warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData()); } else { - plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); + plist = fileFixify(specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"), FileFixifyBackwards); QFile plist_in_file(plist); if (plist_in_file.open(QIODevice::ReadOnly)) { QTextStream plist_in(&plist_in_file); @@ -1505,7 +1505,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QTextStream plist_out(&plist_out_file); plist_out << plist_in_text; t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", "Info.plist") << ";\n"; + } else { + warn_msg(WarnLogic, "Could not write Info.plist: '%s'.", plist_out_file.fileName().toLatin1().constData()); } + } else { + warn_msg(WarnLogic, "Could not open Info.plist: '%s'.", plist.toLatin1().constData()); } } } diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index c4750cb8a4..03196fbc3a 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -140,7 +140,9 @@ UnixMakefileGenerator::init() const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR"); for (int i = 0; i < rpathdirs.size(); ++i) { QString rpathdir = rpathdirs[i].toQString(); - if (!rpathdir.startsWith('@') && !rpathdir.startsWith('$')) + if (rpathdir.length() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(') + rpathdir.replace(0, 1, "\\$$"); // Escape from make and the shell + else if (!rpathdir.startsWith('@')) rpathdir = QFileInfo(rpathdir).absoluteFilePath(); project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(rpathdir); } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 6fb2e7d0a1..975c173ea7 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -703,15 +703,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << " $(OBJECTS) $(OBJCOMP) " << depVar("POST_TARGETDEPS") << "\n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir, false) << "\n\t"; - t << "-$(DEL_FILE) $(TARGET)\n\t" + t << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t" << var("QMAKE_AR_CMD") << "\n"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\t" << var("QMAKE_POST_LINK") << "\n"; if(!project->isEmpty("QMAKE_RANLIB")) - t << "\t$(RANLIB) $(TARGET)\n"; - if(!destdir.isEmpty()) - t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)\n" - << "\t-$(MOVE) $(TARGET) " << destdir << " \n"; + t << "\t$(RANLIB) " << destdir << "$(TARGET)\n"; } else { int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt(); ProStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"), @@ -723,14 +720,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) for(int cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++) build << (*objit); QString ar; - ProString lib = escapeFilePath(*libit); + ProString lib = destdir + escapeFilePath(*libit); if((*libit) == "$(TARGET)") { t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") << ' ' << depVar("POST_TARGETDEPS") << valList(escapeDependencyPaths(build)) << "\n\t"; ar = project->first("QMAKE_AR_CMD").toQString(); ar.replace("$(OBJECTS)", escapeFilePaths(build).join(' ')); } else { - t << escapeDependencyPath(*libit) << ": " << valList(escapeDependencyPaths(build)) << "\n\t"; + t << destdir_d << escapeDependencyPath(*libit) << ": " + << valList(escapeDependencyPaths(build)) << "\n\t"; ar = "$(AR) " + lib + ' ' + escapeFilePaths(build).join(' '); } if(!destdir.isEmpty()) @@ -741,9 +739,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t" << var("QMAKE_POST_LINK") << "\n"; if(!project->isEmpty("QMAKE_RANLIB")) t << "\t$(RANLIB) " << lib << "\n"; - if(!destdir.isEmpty()) - t << "\t-$(DEL_FILE) " << destdir << lib << "\n" - << "\t-$(MOVE) " << lib << ' ' << destdir << " \n"; } } t << endl << endl; @@ -817,7 +812,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << escapeDependencyPath(info_plist_out) << ": \n\t"; info_plist_out = escapeFilePath(info_plist_out); if (!destdir.isEmpty()) - t << mkdir_p_asstring(destdir, false) << "\n\t"; + t << mkdir_p_asstring(destdir) << "\n\t"; ProStringList commonSedArgs; if (!project->values("VERSION").isEmpty()) { commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." @@ -839,6 +834,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) bundleIdentifier.chop(4); if (bundleIdentifier.endsWith(".framework")) bundleIdentifier.chop(10); + // replace invalid bundle id characters + bundleIdentifier.replace('_', '-'); commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "; if (!isFramework) { @@ -1186,7 +1183,7 @@ void UnixMakefileGenerator::init2() project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); project->values("TARGET").first() += "." + project->first("QMAKE_EXTENSION_STATICLIB"); if(project->values("QMAKE_AR_CMD").isEmpty()) - project->values("QMAKE_AR_CMD").append("$(AR) $(TARGET) $(OBJECTS)"); + project->values("QMAKE_AR_CMD").append("$(AR) $(DESTDIR)$(TARGET) $(OBJECTS)"); } else { project->values("TARGETA").append(project->first("DESTDIR") + project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_STATICLIB")); @@ -1328,7 +1325,7 @@ void UnixMakefileGenerator::init2() soname.prepend(instpath); } else if (!project->isEmpty("QMAKE_SONAME_PREFIX")) { QString sonameprefix = project->first("QMAKE_SONAME_PREFIX").toQString(); - if (!sonameprefix.startsWith('@') && !sonameprefix.startsWith('$')) + if (!sonameprefix.startsWith('@')) sonameprefix = Option::fixPathToTargetOS(sonameprefix, false); if (!sonameprefix.endsWith(Option::dir_sep)) sonameprefix += Option::dir_sep; diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index cbf7cf26dc..aad6e6e878 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -643,7 +643,12 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << tagValue("DefaultLanguage", "en") << tagValue("AppContainerApplication", "true") << tagValue("ApplicationType", isWinPhone ? "Windows Phone" : "Windows Store") - << tagValue("ApplicationTypeRevision", tool.SdkVersion == "10.0" ? "8.2" : tool.SdkVersion); + << tagValue("ApplicationTypeRevision", tool.SdkVersion); + if (tool.SdkVersion == "10.0") { + const QString ucrtVersion = qgetenv("UCRTVERSION"); + xml << tagValue("WindowsTargetPlatformVersion", ucrtVersion) + << tagValue("WindowsTargetPlatformMinVersion", ucrtVersion); + } } xml << closetag(); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index aff8d9fcad..7646198da1 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -190,19 +190,24 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) incDirs << vcInstallDir + QStringLiteral("include"); incDirs << vcInstallDir + QStringLiteral("atlmfc/include"); - // ### Investigate why VS uses 10056 first - incDirs << kitDir + QStringLiteral("Include/10.0.10056.0/ucrt"); - incDirs << kitDir + QStringLiteral("Include/10.0.10069.0/ucrt"); - incDirs << kitDir + QStringLiteral("Include/10.0.10069.0/um"); - incDirs << kitDir + QStringLiteral("Include/10.0.10069.0/shared"); - incDirs << kitDir + QStringLiteral("Include/10.0.10069.0/winrt"); + + const QString crtVersion = qgetenv("UCRTVersion"); + if (crtVersion.isEmpty()) { + fprintf(stderr, "Failed to access CRT version.\n"); + return false; + } + const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion; + const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion; + incDirs << crtInclude + QStringLiteral("/ucrt"); + incDirs << crtInclude + QStringLiteral("/um"); + incDirs << crtInclude + QStringLiteral("/shared"); + incDirs << crtInclude + QStringLiteral("/winrt"); libDirs << vcInstallDir + QStringLiteral("lib/store/") + compilerArch; libDirs << vcInstallDir + QStringLiteral("atlmfc/lib") + compilerArch; - // ### Investigate why VS uses 10056 first - libDirs << kitDir + QStringLiteral("lib/10.0.10056.0/ucrt/") + arch; - libDirs << kitDir + QStringLiteral("lib/10.0.10069.0/ucrt/") + arch; - libDirs << kitDir + QStringLiteral("lib/10.0.10069.0/um/") + arch; + + libDirs << crtLib + QStringLiteral("/ucrt/") + arch; + libDirs << crtLib + QStringLiteral("/um/") + arch; } else if (isPhone) { QString sdkDir = vcInstallDir; if (!QDir(sdkDir).exists()) { diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index b8f9c8135d..ae4fcfd482 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1307,7 +1307,8 @@ void VcprojGenerator::initDeploymentTool() } ProStringList dllPaths = project->values("QMAKE_DLL_PATHS"); // Only deploy Qt libs for shared build - if (!dllPaths.isEmpty()) { + if (!dllPaths.isEmpty() && + !(conf.WinRT && project->first("MSVC_VER").toQString() == "14.0")) { // FIXME: This code should actually resolve the libraries from all Qt modules. ProStringList arg = project->values("QMAKE_LIBS") + project->values("QMAKE_LIBS_PRIVATE"); for (ProStringList::ConstIterator it = arg.constBegin(); it != arg.constEnd(); ++it) { |