blob: a3c8cbe4a4e638d741667e93a4e9f011dbc85743 [file] [log] [blame]
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01001package(default_visibility = ["//visibility:public"])
2
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01003cc_library(
4 name = "malloc",
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01005)
6
7cc_library(
8 name = "stl",
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01009)
10
11filegroup(
12 name = "empty",
13 srcs = [],
14)
15
Han-Wen Nienhuys310c6312015-04-08 15:35:26 +000016# This is the entry point for --crosstool_top. Toolchains are found
17# by lopping off the name of --crosstool_top and searching for
18# "cc-compiler-${CPU}" in this BUILD file, where CPU is the target CPU
19# specified in --cpu.
20#
21# This file group should include
22# * all cc_toolchain targets supported
23# * all file groups that said cc_toolchain might refer to,
24# including the default_grte_top setting in the CROSSTOOL
25# protobuf.
Laurent Le Brun08849b22016-09-20 12:21:32 +000026alias(
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010027 name = "toolchain",
Laurent Le Brun08849b22016-09-20 12:21:32 +000028 actual = "//external:cc_toolchain",
Damien Martin-Guillerezbe5b2eb2016-03-02 16:08:07 +000029)
30
31# Hardcoded toolchain, legacy behaviour.
Lukacs Berki180d1b52016-09-06 14:55:21 +000032cc_toolchain_suite(
Damien Martin-Guillerezbe5b2eb2016-03-02 16:08:07 +000033 name = "default-toolchain",
Lukacs Berki180d1b52016-09-06 14:55:21 +000034 toolchains = {
35 "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
36 "darwin|compiler": ":cc-compiler-darwin",
37 "freebsd|compiler": ":cc-compiler-freebsd",
38 "local|compiler": ":cc-compiler-local",
39 "x64_windows|compiler": ":cc-compiler-x64_windows",
40 "x64_windows_msvc|compiler": ":cc-compiler-x64_windows_msvc",
41 },
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010042)
43
44cc_toolchain(
45 name = "cc-compiler-local",
46 all_files = ":empty",
47 compiler_files = ":empty",
48 cpu = "local",
49 dwp_files = ":empty",
50 dynamic_runtime_libs = [":empty"],
51 linker_files = ":empty",
52 objcopy_files = ":empty",
53 static_runtime_libs = [":empty"],
54 strip_files = ":empty",
Han-Wen Nienhuysfc911c62015-10-12 13:10:10 +000055 supports_param_files = 1,
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010056)
57
58cc_toolchain(
Lukacs Berkia93c63b2015-07-29 15:32:19 +000059 name = "cc-compiler-armeabi-v7a",
60 all_files = ":empty",
61 compiler_files = ":empty",
62 cpu = "local",
63 dwp_files = ":empty",
64 dynamic_runtime_libs = [":empty"],
65 linker_files = ":empty",
66 objcopy_files = ":empty",
67 static_runtime_libs = [":empty"],
68 strip_files = ":empty",
Han-Wen Nienhuysfc911c62015-10-12 13:10:10 +000069 supports_param_files = 1,
Lukacs Berkia93c63b2015-07-29 15:32:19 +000070)
71
72cc_toolchain(
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010073 name = "cc-compiler-k8",
74 all_files = ":empty",
75 compiler_files = ":empty",
76 cpu = "local",
77 dwp_files = ":empty",
78 dynamic_runtime_libs = [":empty"],
79 linker_files = ":empty",
80 objcopy_files = ":empty",
81 static_runtime_libs = [":empty"],
82 strip_files = ":empty",
Han-Wen Nienhuysfc911c62015-10-12 13:10:10 +000083 supports_param_files = 1,
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010084)
85
86cc_toolchain(
87 name = "cc-compiler-darwin",
88 all_files = ":empty",
89 compiler_files = ":empty",
90 cpu = "darwin",
91 dwp_files = ":empty",
92 dynamic_runtime_libs = [":empty"],
93 linker_files = ":empty",
94 objcopy_files = ":empty",
95 static_runtime_libs = [":empty"],
96 strip_files = ":empty",
97 supports_param_files = 0,
98)
Damien Martin-Guillerez5cbd5a42015-03-24 21:55:19 +000099
Doug Rabson709bc612015-08-25 14:12:00 +0000100cc_toolchain(
101 name = "cc-compiler-freebsd",
102 all_files = ":empty",
103 compiler_files = ":empty",
104 cpu = "local",
105 dwp_files = ":empty",
106 dynamic_runtime_libs = [":empty"],
107 linker_files = ":empty",
108 objcopy_files = ":empty",
109 static_runtime_libs = [":empty"],
110 strip_files = ":empty",
111 supports_param_files = 0,
112)
113
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000114cc_toolchain(
115 name = "cc-compiler-x64_windows",
116 all_files = ":empty",
117 compiler_files = ":empty",
118 cpu = "local",
119 dwp_files = ":empty",
120 dynamic_runtime_libs = [":empty"],
121 linker_files = ":empty",
122 objcopy_files = ":empty",
123 static_runtime_libs = [":empty"],
124 strip_files = ":empty",
125 supports_param_files = 0,
126)
127
Yun Peng114ead32016-04-07 16:39:19 +0000128cc_toolchain(
129 name = "cc-compiler-x64_windows_msvc",
130 all_files = ":every-file-x64_windows",
131 compiler_files = ":compile-x64_windows",
132 cpu = "x64_windows",
133 dwp_files = ":empty",
134 dynamic_runtime_libs = [":empty"],
135 linker_files = ":empty",
136 objcopy_files = ":empty",
137 static_runtime_libs = [":empty"],
138 strip_files = ":empty",
Yun Peng57be3442016-04-25 14:08:41 +0000139 supports_param_files = 1,
Yun Peng114ead32016-04-07 16:39:19 +0000140)
141
142filegroup(
143 name = "every-file-x64_windows",
144 srcs = [
145 ":compile-x64_windows",
146 ],
147)
148
149filegroup(
150 name = "compile-x64_windows",
151 srcs = glob([
152 "wrapper/bin/msvc_*",
153 "wrapper/bin/pydir/msvc*",
154 ]),
155)
156
Damien Martin-Guillerez5cbd5a42015-03-24 21:55:19 +0000157filegroup(
158 name = "srcs",
Damien Martin-Guillerez9b889202016-03-03 00:35:13 +0000159 srcs = glob(["**"]) + ["//tools/cpp/test:srcs"],
Damien Martin-Guillerez5cbd5a42015-03-24 21:55:19 +0000160)
Marcel Hlopko74b94322016-10-11 15:30:49 +0000161
162filegroup(
163 name = "link_dynamic_library",
164 srcs = ["link_dynamic_library.sh"],
165)