Skip to content

Commit 6b8a08c

Browse files
authored
Add GNU ext. flag for c compile action. (#51)
Some of the libraries that we depend has to be built with gnu ext, like libopenssl. This feature ensure we can switch between them.
1 parent eba6b8c commit 6b8a08c

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

templates/linux/cc_toolchain_config.bzl.template

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ def _impl(ctx):
8585
dbg_feature = feature(name = "dbg")
8686
opt_feature = feature(name = "opt")
8787

88+
# Temp solution until we do not add feature injection
89+
gnu11_feature = feature(name = "gnu11")
90+
8891
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
8992
supports_fission_feature = feature(name = "supports_fission", enabled = True)
9093

@@ -206,7 +209,13 @@ def _impl(ctx):
206209
),
207210
flag_set(
208211
actions = all_c_compile_actions,
209-
flag_groups = DEFAULT_C_COMPILE_FLAGS,
212+
flag_groups = [flag_group(flags = ["-std=c11"])],
213+
with_features = [with_feature_set(not_features = ["gnu11"])],
214+
),
215+
flag_set(
216+
actions = all_c_compile_actions,
217+
flag_groups = [flag_group(flags = ["-std=gnu11"])],
218+
with_features = [with_feature_set(features = ["gnu11"])],
210219
),
211220
flag_set(
212221
actions = all_cpp_compile_actions,
@@ -640,6 +649,7 @@ def _impl(ctx):
640649
ubsan_feature,
641650
dbg_feature,
642651
unfiltered_compile_flags_feature,
652+
gnu11_feature,
643653
default_compile_flags_feature,
644654
default_link_flags_feature,
645655
sysroot_link_flags_feature,

templates/linux/cc_toolchain_flags.bzl.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ DEFAULT_ARM64_COMPILE_FLAGS = get_flag_group([
6565

6666
# Default compile flags for C language when no specific build type is selected.
6767
DEFAULT_C_COMPILE_FLAGS = get_flag_group([
68-
"-std=c11",
6968
])
7069

7170
# Default compile flags for C++ language when no specific build type is selected.

0 commit comments

Comments
 (0)