nixpkgs-suyu/pkgs/development/compilers/llvm/common.nix
Jan Tojnar 192f4171d8
llvm: allow passing arbitrary targets
Mesa requires AMDGPU target but previously, we only allowed a pre-defined set
of targets.
2018-12-24 15:38:55 +01:00

20 lines
509 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
throw "Unsupported system";
llvmBackendList = platforms:
lib.concatStringsSep ";" (map llvmBackend platforms);
}