Skip to content

Commit c801d18

Browse files
committed
[GH:#9202] [Parity] error: unable to spawn process 'metal' (No such file or directory)
1 parent 3c541cc commit c801d18

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Sources/SWBApplePlatform/Specs/MetalCompiler.xcspec

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Identifier = "com.apple.compilers.metal";
1717
Name = "Metal Compiler";
1818
Description = "Compiles Metal files";
19-
CommandLine = "metal -c [options] [inputs]";
19+
CommandLine = "$(MTL_COMPILER_PATH) -c [options] [inputs]";
2020
RuleName = "CompileMetalFile [input]";
2121
ExecDescription = "Compile $(InputFileName)";
2222
ProgressDescription = "Compiling $(CommandProgressByType) Metal files";
@@ -36,6 +36,13 @@
3636
"com.apple.compilers.metal-linker",
3737
);
3838
Options = (
39+
{
40+
Name = "MTL_COMPILER_PATH";
41+
Type = Path;
42+
DefaultValue = "metal";
43+
SetValueInEnvironmentVariable = "MTL_COMPILER_PATH";
44+
Description = "Path to the Metal compiler executable.";
45+
},
3946
{
4047
Name = "MTL_TARGET_TRIPLE";
4148
Type = String;

Sources/SWBApplePlatform/Specs/MetalLinker.xcspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Identifier = "com.apple.compilers.metal-linker";
1717
Name = "Metal Linker";
1818
Description = "Links Metal AIR files";
19-
CommandLine = "metal [options] [inputs]";
19+
CommandLine = "$(MTL_COMPILER_PATH) [options] [inputs]";
2020
RuleName = "MetalLink [output]";
2121
ExecDescription = "Linking Metal AIR $(OutputFile:file)";
2222
ProgressDescription = "Linking Metal AIR $(CommandProgressByType)";

Sources/SwiftBuild/ProjectModel/BuildSettings.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ extension ProjectModel {
113113

114114
// @available(*, deprecated, renamed: "GENERATE_PRELINK_OBJECT_FILE") // can't add @available because it breaks CaseIterable
115115
case GENERATE_MASTER_OBJECT_FILE // ignore-unacceptable-language
116+
case MTL_COMPILER_PATH
116117
}
117118

118119
public enum MultipleValueSetting: String, CaseIterable, Sendable, Hashable, Codable {

0 commit comments

Comments
 (0)