| # Copyright 2025 The Bazel Authors. All rights reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| load("@bazel_features//:features.bzl", "bazel_features") | |
| load("//cc:cc_library.bzl", "cc_library") | |
| load("//cc:cc_test.bzl", "cc_test") | |
| load("//cc/common:semantics.bzl", "STRIP_INCLUDE_PREFIX_APPLIES_TO_TEXTUAL_HEADERS") | |
| licenses(["notice"]) | |
| _SUPPORTED = bazel_features.cc.cc_common_is_in_rules_cc and STRIP_INCLUDE_PREFIX_APPLIES_TO_TEXTUAL_HEADERS | |
| cc_library( | |
| name = "lib", | |
| srcs = ["nested/lib.cc"], | |
| strip_include_prefix = "nested", | |
| target_compatible_with = ["@platforms//:incompatible"] if not _SUPPORTED else [], | |
| textual_hdrs = [ | |
| "nested/lib.h", | |
| "not_nested.h", | |
| ], | |
| ) | |
| cc_test( | |
| name = "test_include_textual", | |
| srcs = ["test_include_textual.cc"], | |
| deps = [":lib"], | |
| ) |