diff --git a/features/custom/qnx/make_cc_features.bzl b/features/custom/qnx/make_cc_features.bzl index 37fb667..31bd544 100644 --- a/features/custom/qnx/make_cc_features.bzl +++ b/features/custom/qnx/make_cc_features.bzl @@ -11,28 +11,6 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -def compute_feature_lists(target_os): - """Returns the flat known/enabled feature label lists for target_os. - - Unlike cc_feature_set (which groups features for requires_any_of/requires_all_of - constraints and does not itself provide FeatureInfo), cc_toolchain_config's - known_features/enabled_features attrs require every entry to individually - provide FeatureInfo — so this returns plain lists of cc_feature labels rather - than a single grouping target. - - Per-instance features (extra_compile_flags, extra_c_compile_flags, - extra_cxx_compile_flags, extra_link_flags, sysroot_link_flags, - compiler_library_search_paths) are baked into _LINUX_FEATURES/_QNX_FEATURES - directly since their target names never change across toolchain instances — - see templates/BUILD.template for where those targets get created. - - Args: - target_os: "linux" or "qnx". - - Returns: - (known_features, enabled_features) tuple of flat label lists. - """ - _QNX_FEATURES = [ ("@score_bazel_cpp_toolchains//features/native/markers:dbg", False), # Bazel auto-toggles via -c dbg ("@score_bazel_cpp_toolchains//features/native/markers:no_legacy_features", True), diff --git a/features/make_cc_features.bzl b/features/make_cc_features.bzl deleted file mode 100644 index 3df4c0a..0000000 --- a/features/make_cc_features.bzl +++ /dev/null @@ -1,40 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2026 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* - -def compute_feature_lists(target_os): - """Returns the flat known/enabled feature label lists for target_os. - - Unlike cc_feature_set (which groups features for requires_any_of/requires_all_of - constraints and does not itself provide FeatureInfo), cc_toolchain_config's - known_features/enabled_features attrs require every entry to individually - provide FeatureInfo — so this returns plain lists of cc_feature labels rather - than a single grouping target. - - Per-instance features (extra_compile_flags, extra_c_compile_flags, - extra_cxx_compile_flags, extra_link_flags, sysroot_link_flags, - compiler_library_search_paths) are baked into _LINUX_FEATURES/_QNX_FEATURES - directly since their target names never change across toolchain instances — - see templates/BUILD.template for where those targets get created. - - Args: - target_os: "linux" or "qnx". - - Returns: - (known_features, enabled_features) tuple of flat label lists. - """ - if target_os == "linux": - return linux_known_features(), linux_enabled_features() - elif target_os == "qnx": - return qnx_known_features(), qnx_enabled_features() - else: - fail("Unsupported target_os '{}', expected 'linux' or 'qnx'".format(target_os)) diff --git a/templates/BUILD.template b/templates/BUILD.template index 55520bb..6d1d822 100644 --- a/templates/BUILD.template +++ b/templates/BUILD.template @@ -43,7 +43,7 @@ make_sysroot_link_flags( ) %{tc_custom_features} # known_features must list every feature (enabled or opt-in); enabled_features is -# the order-irrelevant subset that should start on. See compute_feature_lists(). +# the order-irrelevant subset that should start on. See get_feature_lists(). _KNOWN_FEATURES, _ENABLED_FEATURES = get_feature_lists() filegroup(