|  | # Copyright 2024 The Pigweed Authors | 
|  | # | 
|  | # 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 | 
|  | # | 
|  | #     https://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("@rules_cc//cc:defs.bzl", "cc_library") | 
|  |  | 
|  | package(default_visibility = ["//visibility:public"]) | 
|  |  | 
|  | filegroup( | 
|  | name = "dt_bindings", | 
|  | srcs = glob(["zephyr/dt-bindings/**"]) + [ | 
|  | "zephyr/sys/util_internal.h", | 
|  | "zephyr/sys/util_internal_is_eq.h", | 
|  | "zephyr/sys/util_internal_util_dec.h", | 
|  | "zephyr/sys/util_internal_util_inc.h", | 
|  | "zephyr/sys/util_internal_util_x2.h", | 
|  | "zephyr/sys/util_listify.h", | 
|  | "zephyr/sys/util_loops.h", | 
|  | "zephyr/sys/util_macro.h", | 
|  | ], | 
|  | ) | 
|  |  | 
|  | filegroup( | 
|  | name = "all", | 
|  | srcs = glob(["**/*.h"]), | 
|  | ) | 
|  |  | 
|  | filegroup( | 
|  | name = "core", | 
|  | srcs = glob(["zephyr/**/*.h"]), | 
|  | ) | 
|  |  | 
|  | cc_library( | 
|  | name = "zephyr", | 
|  | hdrs = glob(["zephyr/**/*.h"]), | 
|  | copts = ["-include generated/zephyr/autoconf.h"], | 
|  | deps = select({ | 
|  | "@platforms//cpu:armv7e-m": [ | 
|  | "//modules/cmsis", | 
|  | "@cmsis//:core", | 
|  | ], | 
|  | }) + [ | 
|  | "//:autoconf_library", | 
|  | "//:soc", | 
|  | ], | 
|  | ) | 
|  |  | 
|  | cc_library( | 
|  | name = "posix", | 
|  | hdrs = [ | 
|  | "zephyr/arch/posix/arch.h", | 
|  | "zephyr/arch/posix/arch_inlines.h", | 
|  | "zephyr/arch/posix/asm_inline.h", | 
|  | "zephyr/arch/posix/asm_inline_gcc.h", | 
|  | "zephyr/arch/posix/posix_soc_if.h", | 
|  | "zephyr/arch/posix/posix_trace.h", | 
|  | "zephyr/arch/posix/thread.h", | 
|  | ], | 
|  | includes = [ | 
|  | ".", | 
|  | "../dts", | 
|  | "../dts/common", | 
|  | ], | 
|  | ) |