1# Copyright 2023 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://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, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15# BUILD.bazel file for cmsis_device_xxx. 16 17# buildifier: disable=module-docstring 18# Should point to the corresponding cmsis_core library. Hidden behind a label 19# flag so that it can be overriden in projects that build for more than one 20# family of STM processors. 21label_flag( 22 name = "cmsis_core", 23 build_setting_default = ":unspecified", 24) 25 26# Special target used as a default value of the cmsis_core label_flag. It's not 27# compatible with any platform: To use Pigweed's STM32Cube integration, you 28# must provide a path to cmsis_core. 29cc_library( 30 name = "unspecified", 31 target_compatible_with = ["@platforms//:incompatible"], 32) 33 34cc_library( 35 name = "default_cmsis_init", 36 srcs = glob(["Source/Templates/system_*.c"]), 37 deps = [":cmsis_device"], 38) 39 40cc_library( 41 name = "cmsis_device", 42 hdrs = glob( 43 [ 44 "Include/*.h", 45 ], 46 ), 47 defines = [ 48 "__ARMCC_VERSION=0", 49 ], 50 includes = ["Include"], 51 deps = [ 52 ":cmsis_core", 53 ], 54) 55