-
-
Notifications
You must be signed in to change notification settings - Fork 148
/
BUILD.bazel
41 lines (38 loc) · 1.08 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
load("@rules_cc//cc:defs.bzl", "cc_library")
genrule(
name = "generate_export_header",
srcs = [],
outs = ["include/faker-cxx/export.h"],
cmd = """
echo "#pragma once" > $@
echo "#define FAKER_CXX_EXPORT" >> $@
""",
)
genrule(
name = "generate_version_header",
srcs = [],
outs = ["include/faker-cxx/version.h"],
cmd = """
echo "#pragma once" > $@
echo '#define FAKER_CXX_VERSION_MAJOR 2' >> $@
echo '#define FAKER_CXX_VERSION_MINOR 0' >> $@
echo '#define FAKER_CXX_VERSION_PATCH 0' >> $@
echo '#define FAKER_CXX_VERSION "2.0.0"' >> $@
""",
)
cc_library(
name = "faker-cxx",
srcs = glob(["src/**/*.cpp"]),
hdrs = glob(["src/**/*.h", "include/**/*.h"]) + [":generate_export_header"] + [":generate_version_header"],
includes = ["include", "src"],
visibility = ["//visibility:public"],
deps = ["@fmt//:fmt"],
copts = select({
"//conditions:default": [
"-std=c++20"
],
"@platforms//os:windows": [
"/std:c++20",
],
}),
)