• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15project(Pigweed)
16
17cmake_minimum_required(VERSION 3.16)
18
19# Do not rely on the PW_ROOT environment variable being set through bootstrap.
20# Regardless of whether it's set or not the following include will ensure it is.
21include(pw_build/pigweed.cmake)
22
23if(CONFIG_ZEPHYR_PIGWEED_MODULE)
24  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_ASSERT
25      pw_assert.assert pw_assert_zephyr.assert pw_assert/backend.cmake)
26  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_ASSERT
27      pw_assert.check pw_assert_zephyr.check pw_assert/backend.cmake)
28  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_CHRONO_SYSTEM_CLOCK
29      pw_chrono.system_clock pw_chrono_zephyr.system_clock pw_chrono/backend.cmake)
30  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_INTERRUPT_CONTEXT
31      pw_interrupt.context pw_interrupt_zephyr.context pw_interrupt/backend.cmake)
32  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_LOG_ZEPHYR
33      pw_log pw_log_zephyr pw_log/backend.cmake)
34  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_LOG_TOKENIZED
35      pw_log_tokenized.handler pw_log_zephyr.tokenized_handler pw_log_tokenized/backend.cmake)
36  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_LOG_TOKENIZED
37      pw_log pw_log_tokenized pw_log/backend.cmake)
38  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_THREAD_SLEEP
39      pw_thread.sleep pw_thread_zephyr.sleep pw_thread/backend.cmake)
40  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_SYNC_MUTEX
41      pw_sync.mutex pw_sync_zephyr.mutex_backend pw_sync/backend.cmake)
42  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_SYNC_BINARY_SEMAPHORE
43      pw_sync.mutex pw_sync_zephyr.binary_semaphore_backend pw_sync/backend.cmake)
44  pw_set_zephyr_backend_ifdef(CONFIG_PIGWEED_SYS_IO
45      pw_sys_io pw_sys_io_zephyr pw_sys_io/backend.cmake)
46
47  if(CONFIG_NANOPB AND "${dir_pw_third_party_nanopb}" STREQUAL "")
48    set(dir_pw_third_party_nanopb "${ZEPHYR_NANOPB_MODULE_DIR}" CACHE PATH "" FORCE)
49  endif()
50endif()
51
52add_subdirectory(pw_allocator EXCLUDE_FROM_ALL)
53add_subdirectory(pw_assert EXCLUDE_FROM_ALL)
54add_subdirectory(pw_assert_basic EXCLUDE_FROM_ALL)
55add_subdirectory(pw_assert_log EXCLUDE_FROM_ALL)
56add_subdirectory(pw_assert_zephyr EXCLUDE_FROM_ALL)
57add_subdirectory(pw_base64 EXCLUDE_FROM_ALL)
58add_subdirectory(pw_blob_store EXCLUDE_FROM_ALL)
59add_subdirectory(pw_bluetooth EXCLUDE_FROM_ALL)
60add_subdirectory(pw_build EXCLUDE_FROM_ALL)
61add_subdirectory(pw_build_info EXCLUDE_FROM_ALL)
62add_subdirectory(pw_bytes EXCLUDE_FROM_ALL)
63add_subdirectory(pw_checksum EXCLUDE_FROM_ALL)
64add_subdirectory(pw_chrono EXCLUDE_FROM_ALL)
65add_subdirectory(pw_chrono_freertos EXCLUDE_FROM_ALL)
66add_subdirectory(pw_chrono_stl EXCLUDE_FROM_ALL)
67add_subdirectory(pw_chrono_zephyr EXCLUDE_FROM_ALL)
68add_subdirectory(pw_compilation_testing EXCLUDE_FROM_ALL)
69add_subdirectory(pw_containers EXCLUDE_FROM_ALL)
70add_subdirectory(pw_cpu_exception EXCLUDE_FROM_ALL)
71add_subdirectory(pw_cpu_exception_cortex_m EXCLUDE_FROM_ALL)
72add_subdirectory(pw_digital_io EXCLUDE_FROM_ALL)
73add_subdirectory(pw_file EXCLUDE_FROM_ALL)
74add_subdirectory(pw_function EXCLUDE_FROM_ALL)
75add_subdirectory(pw_hdlc EXCLUDE_FROM_ALL)
76add_subdirectory(pw_interrupt EXCLUDE_FROM_ALL)
77add_subdirectory(pw_interrupt_cortex_m EXCLUDE_FROM_ALL)
78add_subdirectory(pw_interrupt_zephyr EXCLUDE_FROM_ALL)
79add_subdirectory(pw_intrusive_ptr EXCLUDE_FROM_ALL)
80add_subdirectory(pw_kvs EXCLUDE_FROM_ALL)
81add_subdirectory(pw_log EXCLUDE_FROM_ALL)
82add_subdirectory(pw_log_basic EXCLUDE_FROM_ALL)
83add_subdirectory(pw_log_null EXCLUDE_FROM_ALL)
84add_subdirectory(pw_log_string EXCLUDE_FROM_ALL)
85add_subdirectory(pw_log_tokenized EXCLUDE_FROM_ALL)
86add_subdirectory(pw_log_rpc EXCLUDE_FROM_ALL)
87add_subdirectory(pw_log_zephyr EXCLUDE_FROM_ALL)
88add_subdirectory(pw_minimal_cpp_stdlib EXCLUDE_FROM_ALL)
89add_subdirectory(pw_metric EXCLUDE_FROM_ALL)
90add_subdirectory(pw_multisink EXCLUDE_FROM_ALL)
91add_subdirectory(pw_persistent_ram EXCLUDE_FROM_ALL)
92add_subdirectory(pw_perf_test EXCLUDE_FROM_ALL)
93add_subdirectory(pw_polyfill EXCLUDE_FROM_ALL)
94add_subdirectory(pw_preprocessor EXCLUDE_FROM_ALL)
95add_subdirectory(pw_protobuf EXCLUDE_FROM_ALL)
96add_subdirectory(pw_protobuf_compiler EXCLUDE_FROM_ALL)
97add_subdirectory(pw_random EXCLUDE_FROM_ALL)
98add_subdirectory(pw_result EXCLUDE_FROM_ALL)
99add_subdirectory(pw_ring_buffer EXCLUDE_FROM_ALL)
100add_subdirectory(pw_router EXCLUDE_FROM_ALL)
101add_subdirectory(pw_rpc EXCLUDE_FROM_ALL)
102add_subdirectory(pw_snapshot EXCLUDE_FROM_ALL)
103add_subdirectory(pw_span EXCLUDE_FROM_ALL)
104add_subdirectory(pw_status EXCLUDE_FROM_ALL)
105add_subdirectory(pw_stream EXCLUDE_FROM_ALL)
106add_subdirectory(pw_string EXCLUDE_FROM_ALL)
107add_subdirectory(pw_sync EXCLUDE_FROM_ALL)
108add_subdirectory(pw_sync_baremetal EXCLUDE_FROM_ALL)
109add_subdirectory(pw_sync_freertos EXCLUDE_FROM_ALL)
110add_subdirectory(pw_sync_stl EXCLUDE_FROM_ALL)
111add_subdirectory(pw_sync_zephyr EXCLUDE_FROM_ALL)
112add_subdirectory(pw_sys_io EXCLUDE_FROM_ALL)
113add_subdirectory(pw_sys_io_stdio EXCLUDE_FROM_ALL)
114add_subdirectory(pw_sys_io_zephyr EXCLUDE_FROM_ALL)
115add_subdirectory(pw_system EXCLUDE_FROM_ALL)
116add_subdirectory(pw_thread EXCLUDE_FROM_ALL)
117add_subdirectory(pw_thread_freertos EXCLUDE_FROM_ALL)
118add_subdirectory(pw_thread_stl EXCLUDE_FROM_ALL)
119add_subdirectory(pw_thread_zephyr EXCLUDE_FROM_ALL)
120add_subdirectory(pw_tokenizer EXCLUDE_FROM_ALL)
121add_subdirectory(pw_toolchain EXCLUDE_FROM_ALL)
122add_subdirectory(pw_trace EXCLUDE_FROM_ALL)
123add_subdirectory(pw_trace_tokenized EXCLUDE_FROM_ALL)
124add_subdirectory(pw_transfer EXCLUDE_FROM_ALL)
125add_subdirectory(pw_unit_test EXCLUDE_FROM_ALL)
126add_subdirectory(pw_varint EXCLUDE_FROM_ALL)
127add_subdirectory(pw_work_queue EXCLUDE_FROM_ALL)
128
129add_subdirectory(third_party/nanopb EXCLUDE_FROM_ALL)
130add_subdirectory(third_party/freertos EXCLUDE_FROM_ALL)
131add_subdirectory(third_party/fuchsia EXCLUDE_FROM_ALL)
132add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)
133
134if(NOT ZEPHYR_PIGWEED_MODULE_DIR)
135  add_subdirectory(targets/host EXCLUDE_FROM_ALL)
136
137  add_custom_target(pw_apps)
138  add_dependencies(pw_apps pw_hdlc.rpc_example)
139endif()
140