From f377b1ddfb01f654975d8fee1dba3dbed78822e8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 3 Dec 2018 08:35:28 +0100 Subject: qmake: Add support for installing executable files without calling strip Since some files are still executable (such as bash scripts) then they should not get strip called on them when installing in those cases. So by adding .CONFIG = nostrip, it indicates that strip should not be called on this. Fixes: QTBUG-60751 Change-Id: I19d502c07644daf9d487a8817c8e57d96eedab60 Reviewed-by: Oswald Buddenhagen --- qmake/generators/makefile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qmake/generators/makefile.cpp') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 7247d1f8df..765aea4d83 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1289,6 +1289,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) } } bool is_target = (wild == fileFixify(var("TARGET"), FileFixifyAbsolute)); + const bool noStrip = installConfigValues.contains("nostrip"); if(is_target || exists(wild)) { //real file or target QFileInfo fi(fileInfo(wild)); QString dst_file = filePrefixRoot(root, dst_dir); @@ -1302,7 +1303,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) cmd = QLatin1String("-$(QINSTALL)"); cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file); inst << cmd; - if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && + if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) inst << QString("-") + var("QMAKE_STRIP") + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false))); @@ -1337,7 +1338,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) QString cmd = QLatin1String("-$(QINSTALL) ") + escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file); inst << cmd; - if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && + if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) inst << QString("-") + var("QMAKE_STRIP") + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + file, FileFixifyAbsolute, false))); -- cgit v1.2.3