• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2022 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
15load(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_library",
18    "pw_cc_test",
19)
20load(":rust_toolchain.bzl", "pw_rust_toolchain")
21
22package(default_visibility = ["//visibility:public"])
23
24licenses(["notice"])
25
26pw_cc_library(
27    name = "no_destructor",
28    hdrs = ["public/pw_toolchain/no_destructor.h"],
29    includes = ["public"],
30)
31
32pw_cc_test(
33    name = "no_destructor_test",
34    srcs = ["no_destructor_test.cc"],
35    deps = [
36        ":no_destructor",
37        "//pw_unit_test",
38    ],
39)
40
41pw_cc_library(
42    name = "wrap_abort",
43    srcs = ["wrap_abort.cc"],
44    linkopts = ["-Wl,--wrap=abort"],
45    deps = ["//pw_assert"],
46)
47
48# Define rust toolchains that are compatable with @bazel_embedded.
49pw_rust_toolchain(
50    name = "thumbv7m_rust_linux_x86_64",
51    exec_cpu = "x86_64",
52    exec_os = "linux",
53    exec_triple = "x86_64-unknown-linux-gnu",
54    rust_target_triple = "thumbv7m-none-eabi",
55    target_cpu = "armv7-m",
56)
57
58pw_rust_toolchain(
59    name = "thumbv6m_rust_linux_x86_64",
60    exec_cpu = "x86_64",
61    exec_os = "linux",
62    exec_triple = "x86_64-unknown-linux-gnu",
63    rust_target_triple = "thumbv6m-none-eabi",
64    target_cpu = "armv6-m",
65)
66