# Copyright 2022 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. include($ENV{PW_ROOT}/pw_build/pigweed.cmake) include($ENV{PW_ROOT}/pw_system/backend.cmake) # WARNING: Many of the dependencies in this file are missing and need to be # added/updated. This is provided as a starting point, but currently does not # work. pw_add_library(pw_system.config INTERFACE HEADERS public/pw_system/config.h PUBLIC_INCLUDES public ) pw_add_library(pw_system.log STATIC PUBLIC_DEPS pw_log_rpc.log_service pw_log_rpc.rpc_log_drain_thread pw_multisink PRIVATE_DEPS pw_system.config pw_system.rpc_server pw_log_rpc.rpc_log_drain pw_sync.lock_annotations pw_sync.mutex HEADERS pw_system_private/log.h SOURCES log.cc ) pw_add_library(pw_system.log_backend STATIC PRIVATE_DEPS pw_system.config pw_system.log pw_bytes pw_chrono.system_clock pw_log.facade pw_log.proto_utils pw_log_string.handler.facade pw_log_tokenized.handler pw_log_tokenized.metadata pw_multisink pw_result pw_sync.interrupt_spin_lock pw_sync.lock_annotations pw_tokenizer SOURCES log_backend.cc ) pw_add_facade(pw_system.rpc_server INTERFACE BACKEND pw_system.rpc_server_BACKEND HEADERS public/pw_system/rpc_server.h PUBLIC_INCLUDES public PUBLIC_DEPS pw_system.config pw_thread.thread_core ) pw_add_library(pw_system.hdlc_rpc_server STATIC PRIVATE_DEPS pw_assert pw_hdlc.default_addresses pw_hdlc.rpc_channel_output pw_sync.mutex pw_system.config pw_system.io pw_system.rpc_server.facade pw_system.target_io pw_thread.thread_core pw_trace SOURCES hdlc_rpc_server.cc ) pw_add_library(pw_system.thread_snapshot_service STATIC HEADERS public/pw_system/thread_snapshot_service.h PUBLIC_INCLUDES public PUBLIC_DEPS pw_thread.thread_snapshot_service SOURCES thread_snapshot_service.cc ) pw_add_library(pw_system.transfer_handlers STATIC HEADERS public/pw_system/transfer_handlers.h PUBLIC_INCLUDES public PUBLIC_DEPS pw_persistent_ram pw_trace_tokenized.config pw_transfer pw_transfer.proto.pwpb SOURCES transfer_handlers.cc ) pw_add_library(pw_system.file_manager STATIC HEADERS public/pw_system/file_manager.h PUBLIC_INCLUDES public PUBLIC_DEPS pw_system.config pw_system.transfer_handlers pw_persistent_ram.flat_file_system_entry PRIVATE_DEPS pw_system.trace_service SOURCES file_manager.cc ) pw_add_library(pw_system.transfer_service STATIC HEADERS public/pw_system/transfer_service.h PUBLIC_INCLUDES public PUBLIC_DEPS pw_transfer PRIVATE_DEPS pw_system.file_manager SOURCES transfer_service.cc ) pw_add_library(pw_system.file_service STATIC HEADERS public/pw_system/file_service.h PUBLIC_INCLUDES public PRIVATE_DEPS pw_system.file_manager SOURCES file_service.cc ) pw_add_library(pw_system.trace_service STATIC HEADERS public/pw_system/trace_service.h PUBLIC_INCLUDES public PUBLIC_DEPS pw_system.transfer_handlers PRIVATE_DEPS pw_persistent_ram pw_trace_tokenized.trace_service_pwpb SOURCES trace_service.cc ) pw_add_library(pw_system.io INTERFACE HEADERS public/pw_system/io.h PUBLIC_INCLUDES public PUBLIC_DEPS pw_stream ) pw_add_library(pw_system.init STATIC HEADERS public/pw_system/init.h PUBLIC_INCLUDES public SOURCES init.cc PRIVATE_DEPS pw_system.file_service pw_system.log pw_system.rpc_server pw_system.target_hooks pw_system.thread_snapshot_service pw_system.trace_service pw_system.transfer_service pw_system.file_manager pw_system.work_queue pw_rpc.pwpb.echo_service pw_metric.metric_service_pwpb pw_thread.thread pw_trace ) pw_add_library(pw_system.work_queue STATIC HEADERS public/pw_system/work_queue.h PUBLIC_INCLUDES public SOURCES work_queue.cc PUBLIC_DEPS pw_work_queue PRIVATE_DEPS pw_system.config ) pw_add_library(pw_system.target_io STATIC PRIVATE_DEPS pw_system.io pw_stream pw_stream.sys_io_stream SOURCES target_io.cc ) pw_add_facade(pw_system.target_hooks INTERFACE BACKEND pw_system.target_hooks_BACKEND HEADERS public/pw_system/target_hooks.h PUBLIC_INCLUDES public PUBLIC_DEPS pw_thread.thread ) pw_add_library(pw_system.stl_target_hooks STATIC PRIVATE_DEPS pw_system.config pw_thread.sleep pw_thread.thread pw_thread_stl.thread SOURCES stl_target_hooks.cc ) pw_add_library(pw_system.freertos_target_hooks STATIC SOURCES freertos_target_hooks.cc PRIVATE_DEPS pw_system.config pw_thread.thread pw_thread_freertos.thread # TODO: b/234876414 - This should depend on FreeRTOS but our third parties # currently do not have CMake support. ) pw_add_library(pw_system.zephyr_target_hooks STATIC SOURCES zephyr_target_hooks.cc PRIVATE_DEPS pw_system.target_hooks.facade pw_thread.thread pw_thread_zephyr.thread ) pw_add_library(pw_system.system_example STATIC PRIVATE_DEPS pw_system.init pw_system.io pw_system.target_hooks pw_stream pw_stream.sys_io_stream SOURCES example_user_app_init.cc )