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. 14include($ENV{PW_ROOT}/pw_build/pigweed.cmake) 15 16pw_add_module_config(pw_thread_zephyr_CONFIG) 17 18pw_add_library(pw_thread_zephyr.config INTERFACE 19 HEADERS 20 public/pw_thread_zephyr/config.h 21 PUBLIC_INCLUDES 22 public 23 PUBLIC_DEPS 24 "${pw_thread_zephyr_CONFIG}" 25) 26 27# This target provides the backend for pw::Thread::id & pw::this_thread::get_id. 28pw_add_library(pw_thread_zephyr.id INTERFACE 29 HEADERS 30 public/pw_thread_zephyr/id_inline.h 31 public/pw_thread_zephyr/id_native.h 32 id_public_overrides/pw_thread_backend/id_inline.h 33 id_public_overrides/pw_thread_backend/id_native.h 34 PUBLIC_INCLUDES 35 public 36 id_public_overrides 37 PUBLIC_DEPS 38 pw_assert 39 pw_interrupt.context 40 pw_thread.thread.facade 41) 42 43pw_add_library(pw_thread_zephyr.sleep STATIC 44 HEADERS 45 public/pw_thread_zephyr/sleep_inline.h 46 sleep_public_overrides/pw_thread_backend/sleep_inline.h 47 PUBLIC_INCLUDES 48 public 49 sleep_public_overrides 50 PUBLIC_DEPS 51 pw_chrono.system_clock 52 pw_thread.sleep.facade 53 SOURCES 54 sleep.cc 55 PRIVATE_DEPS 56 pw_chrono_zephyr.system_clock 57 pw_assert.check 58) 59 60# This target provides the backend for pw::Thread and the headers needed for 61# thread creation. 62pw_add_library(pw_thread_zephyr.thread STATIC 63 HEADERS 64 public/pw_thread_zephyr/context.h 65 public/pw_thread_zephyr/options.h 66 public/pw_thread_zephyr/thread_inline.h 67 public/pw_thread_zephyr/thread_native.h 68 thread_public_overrides/pw_thread_backend/thread_inline.h 69 thread_public_overrides/pw_thread_backend/thread_native.h 70 PUBLIC_INCLUDES 71 public 72 thread_public_overrides 73 PUBLIC_DEPS 74 pw_assert 75 pw_function 76 pw_span 77 pw_string 78 pw_thread.thread.facade 79 pw_thread_zephyr.config 80 SOURCES 81 thread.cc 82) 83 84pw_add_library(pw_thread_zephyr.thread_iteration STATIC 85 PUBLIC_INCLUDES 86 public 87 thread_public_overrides 88 PUBLIC_DEPS 89 pw_thread.thread_info 90 pw_thread.thread_iteration.facade 91 SOURCES 92 pw_thread_zephyr_private/thread_iteration.h 93 thread_iteration.cc 94) 95