forked from boostorg/process
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
79 lines (73 loc) · 1.99 KB
/
BUILD.bazel
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
bool_flag(
name = "use_std_fs",
visibility = ["//visibility:public"],
build_setting_default = False,
)
config_setting(name = "use_std_fs_enabled", flag_values = {":use_std_fs": "true"})
config_setting(name = "use_std_fs_disabled", flag_values = {":use_std_fs": "false"})
_WINDOWS_HDRS = [
"include/boost/process/detail/windows/*.hpp",
]
_POSIX_HDRS = [
"include/boost/process/detail/posix/*.hpp",
]
cc_library(
name = "process_posix",
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
hdrs = glob(_POSIX_HDRS),
)
cc_library(
name = "process_windows",
target_compatible_with = ["@platforms//os:windows"],
hdrs = glob(_WINDOWS_HDRS),
linkopts = ["-DEFAULTLIB:shell32"],
)
cc_library(
name = "boost.process",
visibility = ["//visibility:public"],
defines = select({
":use_std_fs_enabled": ["BOOST_PROCESS_USE_STD_FS"],
":use_std_fs_disabled": [],
}),
hdrs = glob(
[
"include/**/*.hpp",
"include/**/*.h",
],
exclude = _POSIX_HDRS + _WINDOWS_HDRS,
),
includes = ["include"],
deps = [
"@boost.algorithm",
"@boost.asio",
"@boost.config",
"@boost.core",
"@boost.fusion",
"@boost.io",
"@boost.iterator",
"@boost.move",
"@boost.optional",
"@boost.system",
"@boost.throw_exception",
"@boost.tokenizer",
"@boost.type_index",
"@boost.type_traits",
"@boost.utility",
] + select({
"@platforms//os:windows": [
":process_windows",
"@boost.winapi",
],
"//conditions:default": [
":process_posix",
],
}) + select({
":use_std_fs_disabled": ["@boost.filesystem"],
":use_std_fs_enabled": [],
}),
)