| # Copyright 2026 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:cc_library.bzl", "cc_library") |
| load("@rules_rust//rust:defs.bzl", "rust_library") |
| load("@rules_rust_bindgen//:defs.bzl", "rust_bindgen") |
| |
| licenses(["notice"]) |
| |
| cc_library( |
| name = "freertos_sys_cc_lib", |
| srcs = [ |
| "freertos_sys.c", |
| ], |
| hdrs = [ |
| "freertos_sys.h", |
| ], |
| target_compatible_with = [ |
| "//pw_build/constraints/rtos:freertos", |
| ], |
| deps = [ |
| "//third_party/freertos:config_assert", |
| "@freertos", |
| ], |
| ) |
| |
| rust_bindgen( |
| name = "freertos_sys_bindgen", |
| bindgen_flags = [ |
| "--rust-edition", |
| "2021", |
| "--use-core", |
| ], |
| cc_lib = ":freertos_sys_cc_lib", |
| header = "freertos_sys.h", |
| ) |
| |
| rust_library( |
| name = "freertos_sys", |
| srcs = [ |
| "lib.rs", |
| ":freertos_sys_bindgen", |
| ], |
| edition = "2021", |
| target_compatible_with = [ |
| "//pw_build/constraints/rtos:freertos", |
| ], |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":freertos_sys_cc_lib", |
| ], |
| ) |