|
| 1 | +# Copyright 2025 The Bazel Authors. All rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +load("@bazel_features//private:util.bzl", _bazel_version_ge = "ge") |
| 16 | +load("//cc:cc_library.bzl", "cc_library") |
| 17 | +load("//cc:cc_test.bzl", "cc_test") |
| 18 | +load("//cc/common:semantics.bzl", "STRIP_INCLUDE_PREFIX_APPLIES_TO_TEXTUAL_HEADERS") |
| 19 | + |
| 20 | +licenses(["notice"]) |
| 21 | + |
| 22 | +_SUPPORTED = _bazel_version_ge("9.0.0-pre.20250911") and STRIP_INCLUDE_PREFIX_APPLIES_TO_TEXTUAL_HEADERS |
| 23 | + |
| 24 | +cc_library( |
| 25 | + name = "lib", |
| 26 | + srcs = ["nested/lib.cc"], |
| 27 | + strip_include_prefix = "nested", |
| 28 | + target_compatible_with = ["@platforms//:incompatible"] if not _SUPPORTED else [], |
| 29 | + textual_hdrs = [ |
| 30 | + "nested/lib.h", |
| 31 | + "not_nested.h", |
| 32 | + ], |
| 33 | +) |
| 34 | + |
| 35 | +cc_test( |
| 36 | + name = "test_include_textual", |
| 37 | + srcs = ["test_include_textual.cc"], |
| 38 | + deps = [":lib"], |
| 39 | +) |
0 commit comments