diff options
author | Jake Petroules <jake.petroules@theqtcompany.com> | 2016-04-11 23:07:19 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2016-04-14 11:49:25 +0000 |
commit | 60a2203b9cf41f352e418d611d7953f1edddec2e (patch) | |
tree | 03ddce1d8e8b37081e9735d8c8e2ce3dde9423bb /share | |
parent | 9ec50632e8a9a57c1a02b629d322db27142cdcd0 (diff) |
DRY up some simple code in GenericGCC.
Change-Id: Ib2e9cb84421dcc518822c0cffc5f05b50d603580
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 56 | ||||
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 21 |
2 files changed, 24 insertions, 53 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index ca9c015c3..1424e5297 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -186,23 +186,7 @@ CppModule { artifacts.push(symlink); } } - if (ModUtils.moduleProperty(product, "separateDebugInformation")) { - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoFilePath(product)), - fileTags: ["debuginfo"] - }); - if (PathTools.debugInfoIsBundle(product)) { - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoBundlePath(product)), - fileTags: ["debuginfo_bundle"] - }); - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoPlistFilePath(product)), - fileTags: ["debuginfo_plist"] - }); - } - } - return artifacts; + return artifacts.concat(Gcc.debugInfoArtifacts(product)); } prepare: { @@ -271,24 +255,7 @@ CppModule { PathTools.loadableModuleFilePath(product)), fileTags: ["loadablemodule"] } - var artifacts = [app]; - if (ModUtils.moduleProperty(product, "separateDebugInformation")) { - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoFilePath(product)), - fileTags: ["debuginfo"] - }); - if (PathTools.debugInfoIsBundle(product)) { - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoBundlePath(product)), - fileTags: ["debuginfo_bundle"] - }); - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoPlistFilePath(product)), - fileTags: ["debuginfo_plist"] - }); - } - } - return artifacts; + return [app].concat(Gcc.debugInfoArtifacts(product)); } prepare: { @@ -316,24 +283,7 @@ CppModule { PathTools.applicationFilePath(product)), fileTags: ["application"] } - var artifacts = [app]; - if (ModUtils.moduleProperty(product, "separateDebugInformation")) { - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoFilePath(product)), - fileTags: ["debuginfo"] - }); - if (PathTools.debugInfoIsBundle(product)) { - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoBundlePath(product)), - fileTags: ["debuginfo_bundle"] - }); - artifacts.push({ - filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoPlistFilePath(product)), - fileTags: ["debuginfo_plist"] - }); - } - } - return artifacts; + return [app].concat(Gcc.debugInfoArtifacts(product)); } prepare: { diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 62e8552f8..8c1a3160f 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -856,3 +856,24 @@ function concatLibsFromArtifacts(libs, artifacts) deps.reverse(); return concatLibs(deps, libs); } + +function debugInfoArtifacts(product) { + var artifacts = []; + if (product.moduleProperty("cpp", "separateDebugInformation")) { + artifacts.push({ + filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoFilePath(product)), + fileTags: ["debuginfo"] + }); + if (PathTools.debugInfoIsBundle(product)) { + artifacts.push({ + filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoBundlePath(product)), + fileTags: ["debuginfo_bundle"] + }); + artifacts.push({ + filePath: FileInfo.joinPaths(product.destinationDirectory, PathTools.debugInfoPlistFilePath(product)), + fileTags: ["debuginfo_plist"] + }); + } + } + return artifacts; +} |