From 2ad7f6ddf5042d7442c97a89b083ca2853cf5721 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 24 Feb 2017 16:22:53 +0100 Subject: Preserve last modification timestamps of installed files On non-windows platforms, we use the "-p" parameter of install(1) to preserve the last modification timestamps of files. On Windows the use of copy does not preserve them. As a cross-platform solution, this patch introduces a simple built-in install command in qmake to copy files. Task-number: QTBUG-59004 Change-Id: I3064d29a2b8c7b009a1efbf8f00b84c079ea5417 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qmake/generators/unix/unixmake.cpp') diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 794d04a6e9..0f5e6dc8c0 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -584,7 +584,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) dst = escapeFilePath(filePrefixRoot(root, targetdir + src.section('/', -1))); if(!ret.isEmpty()) ret += "\n\t"; - ret += "-$(INSTALL_FILE) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst; + ret += "-$(QINSTALL_FILE) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst; if(!uninst.isEmpty()) uninst.append("\n\t"); uninst.append("-$(DEL_FILE) " + dst); @@ -622,7 +622,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) if (bundle == SolidBundle) { copy_cmd += "-$(INSTALL_DIR) " + src_targ + ' ' + plain_targ; } else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) { - copy_cmd += "-$(INSTALL_FILE) " + src_targ + ' ' + dst_targ; + copy_cmd += "-$(QINSTALL_FILE) " + src_targ + ' ' + dst_targ; } else if (!isAux) { if (bundle == SlicedBundle) { if (!ret.isEmpty()) -- cgit v1.2.3 From f074d72c8f9354fcf941fe32a9279d9c68944456 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 27 Feb 2017 14:05:06 +0100 Subject: Preserve last modification timestamps of installed program files Similar to the parent commit, this patch adds a unified code path in qmake itself for installing program files while preserving their original last modification timestamp. Change-Id: I7b7dcfa6228c2bfd48ea6036549398bb6f90032f Task-number: QTBUG-59004 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake/generators/unix/unixmake.cpp') diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 0f5e6dc8c0..b485a7ec84 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -629,7 +629,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) ret += "\n\t"; ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false); } - copy_cmd += "-$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ; + copy_cmd += "-$(QINSTALL_PROGRAM) " + src_targ + ' ' + dst_targ; } if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") && project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) { -- cgit v1.2.3 From 097073fa678c6526620f786fbdd6e913a77d54d5 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 11 Apr 2017 14:54:53 -0700 Subject: Fix precompiled headers on Apple platforms, with multiple architectures The original commit only added support for GCC and Clang, but not ICC. Amends 73331eeb Change-Id: Id7638cf1b538edb1008fb3aa10754c1f517a994f Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'qmake/generators/unix/unixmake.cpp') diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index b485a7ec84..1073386a82 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -180,6 +180,13 @@ UnixMakefileGenerator::init() // icc style pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT"))); + const ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS"); + for (const ProString &arch : pchArchs) { + QString suffix = project->first("QMAKE_PCH_OUTPUT_EXT").toQString(); + suffix.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString()); + pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT_") + arch + QLatin1Char('}'), + escapeFilePath(pchBaseName + suffix)); + } } else { // gcc style (including clang_pch_style) QString headerSuffix; @@ -334,10 +341,19 @@ QStringList header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString(); if (project->isActiveConfig("icc_pch_style")) { // icc style - for(QStringList::Iterator it = Option::cpp_ext.begin(); it != Option::cpp_ext.end(); ++it) { - if(file.endsWith(*it)) { - ret += header_prefix; - break; + ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS"); + if (pchArchs.isEmpty()) + pchArchs << ProString(); // normal single-arch PCH + for (const ProString &arch : qAsConst(pchArchs)) { + auto pfx = header_prefix; + if (!arch.isEmpty()) + pfx.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString()); + for (QStringList::Iterator it = Option::cpp_ext.begin(); + it != Option::cpp_ext.end(); ++it) { + if (file.endsWith(*it)) { + ret += pfx; + break; + } } } } else { -- cgit v1.2.3