-
Notifications
You must be signed in to change notification settings - Fork 6
/
BUILD.llvm-raw
48 lines (39 loc) · 1.37 KB
/
BUILD.llvm-raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package(default_visibility = ["//visibility:public"])
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
genrule(
name = "gen_config_site",
outs = ["libcxx/include/__config_site"],
cmd = """echo '
#ifndef _LIBCPP___CONFIG_SITE
#define _LIBCPP___CONFIG_SITE
#define _LIBCPP_ABI_VERSION 1
#define _LIBCPP_ABI_NAMESPACE __1
#define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
#define _LIBCPP_ENABLE_ASSERTIONS_DEFAULT 0
// PSTL backends
#define _LIBCPP_PSTL_CPU_BACKEND_THREAD
// Hardening.
#define _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT 0
#define _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT 0
#endif // _LIBCPP___CONFIG_SITE' > $@""",
)
copy_file(
name = "write_assertion_handler",
src = "libcxx/vendor/llvm/default_assertion_handler.in",
out = "libcxx/include/__assertion_handler",
)
# TODO: gen module.modulemap
# See https://github.com/llvm/llvm-project/blob/9eeb0293e27c0f1b44304fd9681dcd88fd9edc0a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn#L62-L72
pkg_files(
name = "libcxx_include",
srcs = glob(["libcxx/include/**"], exclude = [
"libcxx/include/CMakeLists.txt",
"libcxx/include/__config_site.in",
]) + [
"libcxx/include/__assertion_handler",
"libcxx/include/__config_site",
],
strip_prefix = "libcxx/include",
prefix = "include/c++/v1",
)