mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 20:03:16 +00:00
23 lines
580 B
Nix
23 lines
580 B
Nix
{ lib }:
|
|
|
|
rec {
|
|
llvmBackend = platform:
|
|
if builtins.typeOf platform == "string" then
|
|
platform
|
|
else if platform.parsed.cpu.family == "x86" then
|
|
"X86"
|
|
else if platform.parsed.cpu.name == "aarch64" then
|
|
"AArch64"
|
|
else if platform.parsed.cpu.family == "arm" then
|
|
"ARM"
|
|
else if platform.parsed.cpu.family == "mips" then
|
|
"Mips"
|
|
else if platform.parsed.cpu.family == "power" then
|
|
"PowerPC"
|
|
else
|
|
throw "Unsupported system";
|
|
|
|
llvmBackendList = platforms:
|
|
lib.concatStringsSep ";" (map llvmBackend platforms);
|
|
}
|