aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/GenericGCC.qbs
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/modules/cpp/GenericGCC.qbs')
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs34
1 files changed, 23 insertions, 11 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index b69f26739..934636849 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -44,6 +44,8 @@ CppModule {
condition: qbs.toolchain && qbs.toolchain.contains("gcc")
priority: -100
+ Depends { name: "codesign" }
+
Probes.GccBinaryProbe {
id: compilerPathProbe
condition: !toolchainInstallPath && !_skipAllChecks
@@ -134,8 +136,7 @@ CppModule {
property string toolchainPrefix: compilerPathProbe.found
? compilerPathProbe.tcPrefix
: undefined
- property string toolchainInstallPath: compilerPathProbe.found ? compilerPathProbe.path
- : undefined
+ toolchainInstallPath: compilerPathProbe.found ? compilerPathProbe.path : undefined
property string binutilsPath: binutilsProbe.found ? binutilsProbe.path : toolchainInstallPath
assemblerName: 'as' + compilerExtension
@@ -211,6 +212,11 @@ CppModule {
return createSymlinks && internalVersion && ["macho", "elf"].contains(cpp.imageFormat);
}
+ readonly property bool shouldSignArtifacts: codesign._canSignArtifacts
+ && codesign.enableCodeSigning
+ // codesigning is done during the lipo step
+ && !product.multiplexed
+
property string internalVersion: {
if (product.version === undefined)
return undefined;
@@ -401,12 +407,15 @@ CppModule {
"bundle.input",
"dynamiclibrary", "dynamiclibrary_symlink", "dynamiclibrary_symbols", "debuginfo_dll",
"debuginfo_bundle","dynamiclibrary_import", "debuginfo_plist",
+ "codesign.signed_artifact",
]
outputArtifacts: {
var artifacts = [{
filePath: product.destinationDirectory + "/"
+ PathTools.dynamicLibraryFilePath(product),
- fileTags: ["bundle.input", "dynamiclibrary"],
+ fileTags: ["bundle.input", "dynamiclibrary"]
+ .concat(product.cpp.shouldSignArtifacts
+ ? ["codesign.signed_artifact"] : []),
bundle: {
_bundleFilePath: product.destinationDirectory + "/"
+ PathTools.bundleExecutableFilePath(product)
@@ -511,12 +520,14 @@ CppModule {
inputsFromDependencies: ["dynamiclibrary_symbols", "dynamiclibrary_import", "staticlibrary"]
outputFileTags: ["bundle.input", "loadablemodule", "debuginfo_loadablemodule",
- "debuginfo_bundle","debuginfo_plist"]
+ "debuginfo_bundle", "debuginfo_plist", "codesign.signed_artifact"]
outputArtifacts: {
var app = {
filePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.loadableModuleFilePath(product)),
- fileTags: ["bundle.input", "loadablemodule"],
+ fileTags: ["bundle.input", "loadablemodule"]
+ .concat(product.cpp.shouldSignArtifacts
+ ? ["codesign.signed_artifact"] : []),
bundle: {
_bundleFilePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.bundleExecutableFilePath(product))
@@ -548,13 +559,14 @@ CppModule {
}
inputsFromDependencies: ["dynamiclibrary_symbols", "dynamiclibrary_import", "staticlibrary"]
- outputFileTags: ["bundle.input", "application", "debuginfo_app","debuginfo_bundle",
- "debuginfo_plist", "mem_map"]
+ outputFileTags: ["bundle.input", "application", "debuginfo_app", "debuginfo_bundle",
+ "debuginfo_plist", "mem_map", "codesign.signed_artifact"]
outputArtifacts: {
var app = {
filePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.applicationFilePath(product)),
- fileTags: ["bundle.input", "application"],
+ fileTags: ["bundle.input", "application"].concat(
+ product.cpp.shouldSignArtifacts ? ["codesign.signed_artifact"] : []),
bundle: {
_bundleFilePath: FileInfo.joinPaths(product.destinationDirectory,
PathTools.bundleExecutableFilePath(product))
@@ -566,7 +578,7 @@ CppModule {
if (product.cpp.generateLinkerMapFile) {
artifacts.push({
filePath: FileInfo.joinPaths(product.destinationDirectory,
- product.targetName + ".map"),
+ product.targetName + product.cpp.linkerMapSuffix),
fileTags: ["mem_map"]
});
}
@@ -598,7 +610,7 @@ CppModule {
return [{
fileTags: tags,
filePath: FileInfo.joinPaths(Utilities.getHash(input.baseDir),
- input.fileName + ".o")
+ input.fileName + input.cpp.objectSuffix)
}];
}
@@ -613,7 +625,7 @@ CppModule {
Artifact {
fileTags: ["obj"]
- filePath: FileInfo.joinPaths(Utilities.getHash(input.baseDir), input.fileName + ".o")
+ filePath: FileInfo.joinPaths(Utilities.getHash(input.baseDir), input.fileName + input.cpp.objectSuffix)
}
prepare: {