Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Sources/SWBApplePlatform/Specs/MetalCompiler.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Identifier = "com.apple.compilers.metal";
Name = "Metal Compiler";
Description = "Compiles Metal files";
CommandLine = "metal -c [options] [inputs]";
CommandLine = "$(MTL_COMPILER_PATH) -c [options] [inputs]";
RuleName = "CompileMetalFile [input]";
ExecDescription = "Compile $(InputFileName)";
ProgressDescription = "Compiling $(CommandProgressByType) Metal files";
Expand All @@ -36,6 +36,13 @@
"com.apple.compilers.metal-linker",
);
Options = (
{
Name = "MTL_COMPILER_PATH";
Type = Path;
DefaultValue = "metal";
SetValueInEnvironmentVariable = "MTL_COMPILER_PATH";
Description = "Path to the Metal compiler executable.";
},
{
Name = "MTL_TARGET_TRIPLE";
Type = String;
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBApplePlatform/Specs/MetalLinker.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Identifier = "com.apple.compilers.metal-linker";
Name = "Metal Linker";
Description = "Links Metal AIR files";
CommandLine = "metal [options] [inputs]";
CommandLine = "$(MTL_COMPILER_PATH) [options] [inputs]";
RuleName = "MetalLink [output]";
ExecDescription = "Linking Metal AIR $(OutputFile:file)";
ProgressDescription = "Linking Metal AIR $(CommandProgressByType)";
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftBuild/ProjectModel/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ extension ProjectModel {

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

public enum MultipleValueSetting: String, CaseIterable, Sendable, Hashable, Codable {
Expand Down
Loading