Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 1 | # Copyright 2020 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 | |
Ewout van Bekkum | a0fc38c | 2022-01-14 09:15:53 -0800 | [diff] [blame] | 15 | include($ENV{PW_ROOT}/pw_build/pigweed.cmake) |
| 16 | |
| 17 | pw_add_module_library(pw_polyfill |
| 18 | HEADERS |
| 19 | public/pw_polyfill/language_feature_macros.h |
| 20 | public/pw_polyfill/standard.h |
| 21 | PUBLIC_INCLUDES |
| 22 | public |
| 23 | ) |
Yuval Peress | b8f3ad2 | 2021-10-26 22:55:27 -0600 | [diff] [blame] | 24 | if(Zephyr_FOUND AND CONFIG_PIGWEED_POLYFILL) |
| 25 | zephyr_link_libraries(pw_polyfill) |
| 26 | endif() |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 27 | |
Ewout van Bekkum | a0fc38c | 2022-01-14 09:15:53 -0800 | [diff] [blame] | 28 | # TODO(pwbug/602): Remove this overrides target by migrating all users to |
| 29 | # explicitly depend on the polyfill(s) they require. |
| 30 | pw_add_module_library(pw_polyfill.overrides |
| 31 | PUBLIC_DEPS |
| 32 | pw_polyfill.bit |
| 33 | pw_polyfill.cstddef |
| 34 | pw_polyfill.iterator |
| 35 | pw_polyfill.span |
| 36 | pw_polyfill.type_traits |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 37 | ) |
Yuval Peress | b8f3ad2 | 2021-10-26 22:55:27 -0600 | [diff] [blame] | 38 | if(Zephyr_FOUND AND CONFIG_PIGWEED_POLYFILL_OVERRIDES) |
| 39 | zephyr_link_libraries(pw_polyfill.overrides) |
| 40 | endif() |
Ewout van Bekkum | a0fc38c | 2022-01-14 09:15:53 -0800 | [diff] [blame] | 41 | |
| 42 | # Provides <bit>'s std::endian. |
| 43 | pw_add_module_library(pw_polyfill.bit |
| 44 | HEADERS |
| 45 | public_overrides/bit |
| 46 | standard_library_public/pw_polyfill/standard_library/bit.h |
| 47 | PUBLIC_INCLUDES |
| 48 | public_overrides |
| 49 | standard_library_public |
| 50 | PUBLIC_DEPS |
| 51 | pw_polyfill.standard_library |
| 52 | ) |
| 53 | |
| 54 | # Provides <cstddef>'s std::byte. |
| 55 | pw_add_module_library(pw_polyfill.cstddef |
| 56 | HEADERS |
| 57 | public_overrides/cstddef |
| 58 | standard_library_public/pw_polyfill/standard_library/cstddef.h |
| 59 | PUBLIC_INCLUDES |
| 60 | public_overrides |
| 61 | standard_library_public |
| 62 | PUBLIC_DEPS |
| 63 | pw_polyfill.standard_library |
| 64 | ) |
| 65 | |
| 66 | # TODO(pwbug/603): Remove this polyfill. |
| 67 | pw_add_module_library(pw_polyfill.iterator |
| 68 | HEADERS |
| 69 | public_overrides/iterator |
| 70 | standard_library_public/pw_polyfill/standard_library/iterator.h |
| 71 | PUBLIC_INCLUDES |
| 72 | public_overrides |
| 73 | standard_library_public |
| 74 | PUBLIC_DEPS |
| 75 | pw_polyfill.standard_library |
| 76 | ) |
| 77 | |
| 78 | # Provides <span>. |
| 79 | pw_add_module_library(pw_polyfill.span |
| 80 | PUBLIC_DEPS |
| 81 | pw_span |
| 82 | ) |
| 83 | |
| 84 | # TODO(pwbug/603): Remove this polyfill. |
| 85 | pw_add_module_library(pw_polyfill.type_traits |
| 86 | HEADERS |
| 87 | public_overrides/type_traits |
| 88 | standard_library_public/pw_polyfill/standard_library/type_traits.h |
| 89 | PUBLIC_INCLUDES |
| 90 | public_overrides |
| 91 | standard_library_public |
| 92 | PUBLIC_DEPS |
| 93 | pw_polyfill.standard_library |
| 94 | ) |
| 95 | |
| 96 | pw_add_module_library(pw_polyfill.standard_library |
| 97 | HEADERS |
| 98 | standard_library_public/pw_polyfill/standard_library/namespace.h |
| 99 | PUBLIC_INCLUDES |
| 100 | standard_library_public |
| 101 | ) |