Skip to content

Commit ebc90cd

Browse files
authored
Add pic feature to QNX cc_toolchain_config (#108)
Introduce a `pic` feature that passes -fPIC for compile/assemble actions when the `pic` variable is available, and register it in the toolchain feature list.
1 parent b742f0f commit ebc90cd

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

templates/qnx/cc_toolchain_config.bzl.template

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,26 @@ def _impl(ctx):
642642
)
643643
supports_pic_feature = feature(name = "supports_pic", enabled = True)
644644

645+
pic_feature = feature(
646+
name = "pic",
647+
enabled = True,
648+
flag_sets = [
649+
flag_set(
650+
actions = [
651+
ACTION_NAMES.assemble,
652+
ACTION_NAMES.preprocess_assemble,
653+
ACTION_NAMES.c_compile,
654+
ACTION_NAMES.cpp_compile,
655+
ACTION_NAMES.cpp_module_codegen,
656+
ACTION_NAMES.cpp_module_compile,
657+
],
658+
flag_groups = [
659+
flag_group(flags = ["-fPIC"], expand_if_available = "pic"),
660+
],
661+
),
662+
],
663+
)
664+
645665
dependency_file_named_implicitly_feature = feature(
646666
name = "dependency_file_named_implicitly",
647667
enabled = False,
@@ -809,6 +829,7 @@ def _impl(ctx):
809829
sdp_env_feature,
810830
supports_dynamic_linker_feature,
811831
supports_pic_feature,
832+
pic_feature,
812833
runtime_library_search_directories_feature,
813834
coverage_feature,
814835
gcc_coverage_map_format_feature,

0 commit comments

Comments
 (0)