@@ -37,13 +37,15 @@ extension LLBuildManifestBuilder {
37
37
let targetName = try buildProduct. product. getLLBuildTargetName ( config: self . buildConfig)
38
38
let output : Node = . virtual( targetName)
39
39
40
+ let finalProductNode : Node
40
41
switch buildProduct. product. type {
41
42
case . library( . static) :
43
+ finalProductNode = try . file( buildProduct. binaryPath)
42
44
try self . manifest. addShellCmd (
43
45
name: cmdName,
44
46
description: " Archiving \( buildProduct. binaryPath. prettyPath ( ) ) " ,
45
47
inputs: ( buildProduct. objects + [ buildProduct. linkFileListPath] ) . map ( Node . file) ,
46
- outputs: [ . file ( buildProduct . binaryPath ) ] ,
48
+ outputs: [ finalProductNode ] ,
47
49
arguments: try buildProduct. archiveArguments ( )
48
50
)
49
51
@@ -54,22 +56,24 @@ extension LLBuildManifestBuilder {
54
56
+ testInputs
55
57
56
58
let shouldCodeSign : Bool
59
+ let linkedBinaryNode : Node
60
+ let linkedBinaryPath = try buildProduct. binaryPath
57
61
if case . executable = buildProduct. product. type,
62
+ buildParameters. targetTriple. isMacOSX,
58
63
buildParameters. debuggingParameters. shouldEnableDebuggingEntitlement {
59
64
shouldCodeSign = true
65
+ linkedBinaryNode = try . file( buildProduct. binaryPath, isMutated: true )
60
66
} else {
61
67
shouldCodeSign = false
68
+ linkedBinaryNode = try . file( buildProduct. binaryPath)
62
69
}
63
70
64
- let linkedBinarySuffix = shouldCodeSign ? " -unsigned " : " "
65
- let linkedBinaryPath = try AbsolutePath ( validating: buildProduct. binaryPath. pathString + linkedBinarySuffix)
66
-
67
71
try self . manifest. addShellCmd (
68
72
name: cmdName,
69
73
description: " Linking \( buildProduct. binaryPath. prettyPath ( ) ) " ,
70
74
inputs: inputs. map ( Node . file) ,
71
- outputs: [ . file ( linkedBinaryPath ) ] ,
72
- arguments: try buildProduct. linkArguments ( outputPathSuffix : linkedBinarySuffix )
75
+ outputs: [ linkedBinaryNode ] ,
76
+ arguments: try buildProduct. linkArguments ( )
73
77
)
74
78
75
79
if shouldCodeSign {
@@ -86,25 +90,20 @@ extension LLBuildManifestBuilder {
86
90
try self . manifest. addShellCmd (
87
91
name: " \( cmdName) -entitlements " ,
88
92
description: " Applying debug entitlements to \( buildProduct. binaryPath. prettyPath ( ) ) " ,
89
- inputs: [ linkedBinaryPath , plistPath ] . map ( Node . file) ,
93
+ inputs: [ linkedBinaryNode , . file( plistPath ) ] ,
90
94
outputs: [ codeSigningOutput] ,
91
95
arguments: buildProduct. codeSigningArguments ( plistPath: plistPath, binaryPath: linkedBinaryPath)
92
96
)
93
-
94
- try self . manifest. addShellCmd (
95
- name: " \( cmdName) -codesigning " ,
96
- description: " Applying debug entitlements to \( buildProduct. binaryPath. prettyPath ( ) ) " ,
97
- inputs: [ codeSigningOutput] ,
98
- outputs: [ . file( buildProduct. binaryPath) ] ,
99
- arguments: [ " mv " , linkedBinaryPath. pathString, buildProduct. binaryPath. pathString]
100
- )
97
+ finalProductNode = codeSigningOutput
98
+ } else {
99
+ finalProductNode = linkedBinaryNode
101
100
}
102
101
}
103
102
104
103
self . manifest. addNode ( output, toTarget: targetName)
105
- try self . manifest. addPhonyCmd (
104
+ self . manifest. addPhonyCmd (
106
105
name: output. name,
107
- inputs: [ . file ( buildProduct . binaryPath ) ] ,
106
+ inputs: [ finalProductNode ] ,
108
107
outputs: [ output]
109
108
)
110
109
0 commit comments