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 15include("$ENV{PW_ROOT}/pw_build/pigweed.cmake") 16 17add_subdirectory(arm_gcc EXCLUDE_FROM_ALL) 18 19pw_add_library(pw_toolchain.constexpr_tag INTERFACE 20 HEADERS 21 public/pw_toolchain/constexpr_tag.h 22 PUBLIC_INCLUDES 23 public 24) 25 26pw_add_library(pw_toolchain.no_destructor INTERFACE 27 HEADERS 28 public/pw_toolchain/no_destructor.h 29 PUBLIC_INCLUDES 30 public 31) 32 33pw_add_test(pw_toolchain.no_destructor_test 34 SOURCES 35 no_destructor_test.cc 36 PRIVATE_DEPS 37 pw_assert.check 38 pw_polyfill 39 pw_toolchain.no_destructor 40 GROUPS 41 modules 42 pw_toolchain 43) 44 45pw_add_library(pw_toolchain.globals INTERFACE 46 HEADERS 47 public/pw_toolchain/globals.h 48 PUBLIC_INCLUDES 49 public 50) 51 52pw_add_test(pw_toolchain.globals_test 53 SOURCES 54 globals_test.cc 55 PRIVATE_DEPS 56 pw_assert.check 57 pw_polyfill 58 pw_toolchain.globals 59 GROUPS 60 modules 61 pw_toolchain 62) 63 64pw_add_library(pw_toolchain.infinite_loop INTERFACE 65 HEADERS 66 public/pw_toolchain/infinite_loop.h 67 PUBLIC_DEPS 68 pw_preprocessor 69 PUBLIC_INCLUDES 70 public 71) 72 73pw_add_test(pw_toolchain.infinite_loop_test 74 SOURCES 75 infinite_loop_test.cc 76 infinite_loop_test_c.c 77 PRIVATE_DEPS 78 pw_toolchain.infinite_loop 79 GROUPS 80 modules 81 pw_toolchain 82) 83 84pw_add_library(pw_toolchain._sibling_cast INTERFACE 85 HEADERS 86 public/pw_toolchain/internal/sibling_cast.h 87 PUBLIC_INCLUDES 88 public 89) 90 91pw_add_test(pw_toolchain.sibling_cast_test 92 SOURCES 93 sibling_cast_test.cc 94 PRIVATE_DEPS 95 pw_compilation_testing._pigweed_only_negative_compilation 96 pw_toolchain._sibling_cast 97 GROUPS 98 modules 99 pw_toolchain 100) 101 102pw_add_library(pw_toolchain.wrap_abort STATIC 103 SOURCES 104 wrap_abort.cc 105 PUBLIC_DEPS 106 pw_assert 107 PUBLIC_LINK_OPTIONS 108 "-Wl,--wrap=abort" 109) 110