summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/common.nix
blob: 27f48ff3f113df6ebde1331a2fbf2217df141efe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ 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);
}