• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load(":cc_toolchain_config.bzl", "cc_toolchain_config")
2
3package(default_visibility = ["//visibility:public"])
4
5filegroup(name = "empty")
6
7TOOLCHAINS = {
8    "osx-x86_64": "cc-compiler-osx-x86_64",
9    "osx-aarch_64": "cc-compiler-osx-aarch_64",
10    "linux-aarch_64": "cc-compiler-linux-aarch_64",
11    "linux-ppcle_64": "cc-compiler-linux-ppcle_64",
12    "linux-s390_64": "cc-compiler-linux-s390_64",
13    "linux-x86_32": "cc-compiler-linux-x86_32",
14    "linux-x86_64": "cc-compiler-linux-x86_64",
15    "win32": "cc-compiler-windows-x86_32",
16    "win64": "cc-compiler-windows-x86_64",
17    "k8": "cc-compiler-k8",
18}
19
20cc_toolchain_suite(
21    name = "clang_suite",
22    toolchains = TOOLCHAINS
23)
24
25[
26    cc_toolchain(
27        name = toolchain,
28        all_files = ":empty",
29        compiler_files = ":empty",
30        dwp_files = ":empty",
31        dynamic_runtime_lib = ":empty",
32        linker_files = ":empty",
33        objcopy_files = ":empty",
34        output_licenses = ["restricted"],
35        static_runtime_lib = ":empty",
36        strip_files = ":empty",
37        toolchain_config = ":" + cpu + "-config",
38        toolchain_identifier = toolchain,
39    )
40    for cpu, toolchain in TOOLCHAINS.items()
41]
42
43cc_toolchain_config(
44    name = "k8-config",
45    linker_path = "/usr/bin/ld",
46    sysroot = "/opt/manylinux/2014/x86_64",
47    target_cpu = "x86_64",
48    target_full_name = "x86_64-linux-gnu",
49)
50
51cc_toolchain_config(
52    name = "linux-aarch_64-config",
53    sysroot = "/opt/manylinux/2014/aarch64",
54    linker_path = "/usr/bin/ld",
55    target_cpu = "aarch64",
56    target_full_name = "aarch64-linux-gnu",
57)
58
59cc_toolchain_config(
60    name = "linux-ppcle_64-config",
61    linker_path = "/usr/bin/ld",
62    sysroot = "/opt/manylinux/2014/ppc64le",
63    target_cpu = "ppc64",
64    target_full_name = "powerpc64le-linux-gnu",
65)
66
67cc_toolchain_config(
68    name = "linux-s390_64-config",
69    linker_path = "/usr/bin/ld",
70    sysroot = "/opt/manylinux/2014/s390x",
71    target_cpu = "systemz",
72    target_full_name = "s390x-linux-gnu",
73)
74
75cc_toolchain_config(
76    name = "linux-x86_32-config",
77    linker_path = "/usr/bin/ld",
78    sysroot = "/opt/manylinux/2014/i686",
79    target_cpu = "x86_32",
80    target_full_name = "i386-linux-gnu",
81)
82
83cc_toolchain_config(
84    name = "linux-x86_64-config",
85    linker_path = "/usr/bin/ld",
86    sysroot = "/opt/manylinux/2014/x86_64",
87    target_cpu = "x86_64",
88    target_full_name = "x86_64-linux-gnu",
89)
90
91cc_toolchain_config(
92    name = "osx-aarch_64-config",
93    extra_compiler_flags = [
94        "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include/c++/v1",
95        "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include"
96    ],
97    linker_path = "/usr/tools",
98    sysroot = "/usr/tools/apple_sdks/xcode_13_0/macosx",
99    target_cpu = "aarch64",
100    target_full_name = "aarch64-apple-macosx11.3",
101)
102
103cc_toolchain_config(
104    name = "osx-x86_64-config",
105    extra_compiler_flags = [
106        "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include/c++/v1",
107        "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include"
108    ],
109    linker_path = "/usr/tools",
110    sysroot = "/usr/tools/apple_sdks/xcode_13_0/macosx",
111    target_cpu = "x86_64",
112    target_full_name = "x86_64-apple-macosx11.3",
113)
114
115cc_toolchain_config(
116    name = "win32-config",
117    extra_compiler_flags = [
118        "-isystem/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++",
119        "-isystem/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++/i686-w64-mingw32",
120        "-fsjlj-exceptions",
121    ],
122    extra_include = "/usr/lib/gcc/i686-w64-mingw32",
123    extra_linker_flags = [
124        "-L/usr/lib/gcc/i686-w64-mingw32/8.3-posix",
125        "-pthread",
126    ],
127    linker_path = "/usr/bin/ld",
128    sysroot = "/usr/i686-w64-mingw32",
129    target_cpu = "x86_32",
130    target_full_name = "i686-w64-mingw32",
131)
132
133cc_toolchain_config(
134    name = "win64-config",
135    extra_compiler_flags = [
136        "-isystem/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/",
137        "-isystem/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/x86_64-w64-mingw32",
138    ],
139    extra_include = "/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include",
140    extra_linker_flags = [
141        "-L/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix",
142    ],
143    linker_path = "/usr/bin/ld",
144    sysroot = "/usr/x86_64-w64-mingw32",
145    target_cpu = "x86_64",
146    target_full_name = "x86_64-w64-mingw32",
147)
148