Skip to content

Commit 70dd95f

Browse files
authored
third_party: rapidcheck: add flag to disable rtti (#54)
We need to have an option to enable or disable rtti in rapidcheck based on how we've configured our own build. Most of the time we build with `-fno-rtti`. Mixing the two leads to awful and hard to diagnose build errors.
1 parent f631fd6 commit 70dd95f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

third_party/rapidcheck.BUILD

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,32 @@
88
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
99
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
1010

11+
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
12+
1113
package(
1214
default_visibility = ["//visibility:public"],
1315
)
1416

17+
bool_flag(
18+
name = "disable_rtti",
19+
build_setting_default = False,
20+
visibility = ["//visibility:public"],
21+
)
22+
23+
config_setting(
24+
name = "_disable_rtti",
25+
flag_values = {":disable_rtti": "true"},
26+
visibility = ["//visibility:public"],
27+
)
28+
1529
cc_library(
1630
name = "rapidcheck",
1731
srcs = glob(["src/**"]),
1832
hdrs = glob(["include/**"] + ["extras/**"]),
33+
defines = select({
34+
":_disable_rtti": ["RC_DONT_USE_RTTI"],
35+
"//conditions:default": [],
36+
}),
1937
includes = [
2038
"extras/gtest/include",
2139
"include",

0 commit comments

Comments
 (0)