Skip to content

Commit 643e16d

Browse files
authored
cc: Re-enable -fno-rtti and -fno-exceptions [BUILD-642] [BUILD-643]
Re-enables the new `swift_cc`/`swift_c` implementations now that the codebase as been prepped for this to land.
1 parent be2252f commit 643e16d

File tree

3 files changed

+321
-42
lines changed

3 files changed

+321
-42
lines changed

.bazeliskrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
USE_BAZEL_VERSION=6.0.0

cc/BUILD.bazel

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
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")
11+
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
1212

1313
exports_files(
1414
glob(["*.bzl"]),
1515
visibility = ["//visibility:public"],
1616
)
1717

18+
# Disable tests and test libraries with --@rules_swiftnav//:disable_test=true
1819
bool_flag(
1920
name = "disable_tests",
2021
build_setting_default = False,
@@ -26,3 +27,57 @@ config_setting(
2627
flag_values = {":disable_tests": "true"},
2728
visibility = ["//visibility:public"],
2829
)
30+
31+
# Enable exceptions with --@rules_swiftnav//:enable_exceptions=true
32+
bool_flag(
33+
name = "enable_exceptions",
34+
build_setting_default = False,
35+
visibility = ["//visibility:public"],
36+
)
37+
38+
config_setting(
39+
name = "_enable_exceptions",
40+
flag_values = {":enable_exceptions": "true"},
41+
visibility = ["//visibility:public"],
42+
)
43+
44+
# Enable rtti with --@rules_swiftnav//:enable_exceptions=true
45+
bool_flag(
46+
name = "enable_rtti",
47+
build_setting_default = False,
48+
visibility = ["//visibility:public"],
49+
)
50+
51+
config_setting(
52+
name = "_enable_rtti",
53+
flag_values = {":enable_rtti": "true"},
54+
visibility = ["//visibility:public"],
55+
)
56+
57+
# Allows us to experiment with building the codebase with different standards.
58+
string_flag(
59+
name = "cxx_standard",
60+
build_setting_default = "", #inactive by default
61+
visibility = ["//visibility:public"],
62+
)
63+
64+
# Enable with --@rules_swiftnav//:cxx_standard=17
65+
config_setting(
66+
name = "cxx17",
67+
flag_values = {":cxx_standard": "17"},
68+
visibility = ["//visibility:public"],
69+
)
70+
71+
# Enable with --@rules_swiftnav//:cxx_standard=20
72+
config_setting(
73+
name = "cxx20",
74+
flag_values = {":cxx_standard": "20"},
75+
visibility = ["//visibility:public"],
76+
)
77+
78+
# Enable with --@rules_swiftnav//:cxx_standard=23
79+
config_setting(
80+
name = "cxx23",
81+
flag_values = {":cxx_standard": "23"},
82+
visibility = ["//visibility:public"],
83+
)

0 commit comments

Comments
 (0)