forked from CLIUtils/CLI11
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
28 lines (25 loc) · 921 Bytes
/
Copy pathBUILD.bazel
File metadata and controls
28 lines (25 loc) · 921 Bytes
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
load("@rules_cc//cc:defs.bzl", "cc_library")
# CLI::argv() needs CommandLineToArgvW from shell32 on Windows
WINDOWS_LINKOPTS = select({
"@rules_cc//cc/compiler:msvc-cl": ["-DEFAULTLIB:shell32.lib"],
"@rules_cc//cc/compiler:clang-cl": ["-DEFAULTLIB:shell32.lib"],
"@rules_cc//cc/compiler:mingw-gcc": ["-lshell32"],
"//conditions:default": [],
})
cc_library(
name = "cli11",
srcs = glob(["src/**/*.cpp"]),
hdrs = glob(["include/**/*.hpp"]),
defines = ["CLI11_COMPILE", "CLI11_ENABLE_EXTRA_VALIDATORS=1"],
linkopts = WINDOWS_LINKOPTS,
strip_include_prefix = "/include",
visibility = ["//visibility:public"],
)
# Header-only mode, like the CMake target without CLI11_PRECOMPILED
cc_library(
name = "cli11_header_only",
hdrs = glob(["include/**/*.hpp"]),
linkopts = WINDOWS_LINKOPTS,
strip_include_prefix = "/include",
visibility = ["//visibility:public"],
)