@@ -32,16 +32,13 @@ public func describe(_ prefix: AbsolutePath, _ conf: Configuration, _ graph: Pac
32
32
try makeDirectories ( prefix)
33
33
let swiftcArgs = flags. cCompilerFlags. flatMap { [ " -Xcc " , $0] } + flags. swiftCompilerFlags + verbosity. ccArgs
34
34
35
- let SWIFT_EXEC = toolchain. swiftCompiler
36
- let CC = getenv ( " CC " ) ?? " clang "
37
-
38
35
var commands = [ Command] ( )
39
36
var targets = Targets ( )
40
37
41
38
for module in graph. modules {
42
39
switch module {
43
40
case let module as SwiftModule :
44
- let compile = try Command . compile ( swiftModule: module, configuration: conf, prefix: prefix, otherArgs: swiftcArgs + toolchain. swiftPlatformArgs, SWIFT_EXEC : SWIFT_EXEC . asString )
41
+ let compile = try Command . compile ( swiftModule: module, configuration: conf, prefix: prefix, otherArgs: swiftcArgs + toolchain. swiftPlatformArgs, compilerExec : toolchain . swiftCompiler )
45
42
commands. append ( compile)
46
43
targets. append ( [ compile] , for: module)
47
44
@@ -51,7 +48,7 @@ public func describe(_ prefix: AbsolutePath, _ conf: Configuration, _ graph: Pac
51
48
if module. isTest { continue }
52
49
#endif
53
50
// FIXME: Find a way to eliminate `externalModules` from here.
54
- let compile = try Command . compile ( clangModule: module, externalModules: graph. externalModules, configuration: conf, prefix: prefix, CC : CC , otherArgs: flags. cCompilerFlags + toolchain. clangPlatformArgs)
51
+ let compile = try Command . compile ( clangModule: module, externalModules: graph. externalModules, configuration: conf, prefix: prefix, otherArgs: flags. cCompilerFlags + toolchain. clangPlatformArgs, compilerExec : toolchain . clangCompiler )
55
52
commands += compile
56
53
targets. append ( compile, for: module)
57
54
@@ -74,9 +71,9 @@ public func describe(_ prefix: AbsolutePath, _ conf: Configuration, _ graph: Pac
74
71
#endif
75
72
let command : Command
76
73
if product. containsOnlyClangModules {
77
- command = try Command . linkClangModule ( product, configuration: conf, prefix: prefix, otherArgs: Xld, CC : CC )
74
+ command = try Command . linkClangModule ( product, configuration: conf, prefix: prefix, otherArgs: Xld, linkerExec : toolchain . clangCompiler )
78
75
} else {
79
- command = try Command . linkSwiftModule ( product, configuration: conf, prefix: prefix, otherArgs: Xld + swiftcArgs + toolchain. swiftPlatformArgs + rpathArgs, SWIFT_EXEC : SWIFT_EXEC . asString )
76
+ command = try Command . linkSwiftModule ( product, configuration: conf, prefix: prefix, otherArgs: Xld + swiftcArgs + toolchain. swiftPlatformArgs + rpathArgs, linkerExec : toolchain . swiftCompiler )
80
77
}
81
78
82
79
commands. append ( command)
0 commit comments