Skip to content
Merged
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
8 changes: 8 additions & 0 deletions Sources/SWBAndroidPlatform/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ struct AndroidPlatformExtension: PlatformInfoExtension {
])
]
}

func platformName(triple: LLVMTriple) -> String? {
if triple.system == "linux" && triple.environment?.hasPrefix("android") == true {
return "android"
}

return nil
}
}

@_spi(Testing) public struct AndroidSDKRegistryExtension: SDKRegistryExtension {
Expand Down
11 changes: 11 additions & 0 deletions Sources/SWBGenericUnixPlatform/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ struct GenericUnixPlatformInfoExtension: PlatformInfoExtension {
])
}
}

func platformName(triple: LLVMTriple) -> String? {
switch triple.system {
case "linux" where triple.environment?.hasPrefix("gnu") == true || triple.environment == "musl",
"freebsd",
"openbsd":
return triple.system
default:
return nil
}
}
}

struct GenericUnixSDKRegistryExtension: SDKRegistryExtension {
Expand Down
8 changes: 8 additions & 0 deletions Sources/SWBQNXPlatform/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ struct QNXPlatformExtension: PlatformInfoExtension {
])
]
}

func platformName(triple: LLVMTriple) -> String? {
if triple.system == "nto" {
return "qnx"
}

return nil
}
}

struct QNXSDKRegistryExtension: SDKRegistryExtension {
Expand Down
8 changes: 8 additions & 0 deletions Sources/SWBWindowsPlatform/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ struct WindowsPlatformExtension: PlatformInfoExtension {
return []
}
}

public func platformName(triple: LLVMTriple) -> String? {
if triple.system == "windows" {
return triple.system
}

return nil
}
}

struct WindowsSDKRegistryExtension: SDKRegistryExtension {
Expand Down
Loading