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 15# Do not rely on the PW_ROOT environment variable being set through bootstrap. 16# Regardless of whether it's set or not the following include will ensure it is. 17include(${CMAKE_CURRENT_LIST_DIR}/../../pw_build/pigweed.cmake) 18 19include($ENV{PW_ROOT}/pw_assert/backend.cmake) 20include($ENV{PW_ROOT}/pw_async2/backend.cmake) 21include($ENV{PW_ROOT}/pw_chrono/backend.cmake) 22include($ENV{PW_ROOT}/pw_log/backend.cmake) 23include($ENV{PW_ROOT}/pw_perf_test/backend.cmake) 24include($ENV{PW_ROOT}/pw_rpc/system_server/backend.cmake) 25include($ENV{PW_ROOT}/pw_sync/backend.cmake) 26include($ENV{PW_ROOT}/pw_sys_io/backend.cmake) 27include($ENV{PW_ROOT}/pw_system/backend.cmake) 28include($ENV{PW_ROOT}/pw_thread/backend.cmake) 29include($ENV{PW_ROOT}/pw_trace/backend.cmake) 30include($ENV{PW_ROOT}/pw_trace_tokenized/backend.cmake) 31 32set(CMAKE_C_COMPILER gcc) 33set(CMAKE_CXX_COMPILER g++) 34 35pw_add_global_compile_options(-std=c++20 LANGUAGES CXX) 36 37# Configure backend for assert facade. 38pw_set_backend(pw_assert.check pw_assert.print_and_abort_check_backend) 39pw_set_backend(pw_assert.assert pw_assert.print_and_abort_assert_backend) 40 41# Configure backend for async dispatcher facade 42pw_set_backend(pw_async2.dispatcher pw_async2_epoll.dispatcher_backend) 43 44# Configure backend for logging facade. 45pw_set_backend(pw_log pw_log_basic) 46 47# Configure backends for pw_sync's facades. 48pw_set_backend(pw_sync.interrupt_spin_lock pw_sync_stl.interrupt_spin_lock) 49pw_set_backend(pw_sync.binary_semaphore pw_sync_stl.binary_semaphore_backend) 50pw_set_backend(pw_sync.counting_semaphore 51 pw_sync_stl.counting_semaphore_backend) 52pw_set_backend(pw_sync.mutex pw_sync_stl.mutex_backend) 53pw_set_backend(pw_sync.timed_mutex pw_sync_stl.timed_mutex_backend) 54pw_set_backend(pw_sync.thread_notification 55 pw_sync.binary_semaphore_thread_notification_backend) 56pw_set_backend(pw_sync.timed_thread_notification 57 pw_sync.binary_semaphore_timed_thread_notification_backend) 58 59# Configure backend for pw_sys_io facade. 60pw_set_backend(pw_sys_io pw_sys_io_stdio) 61 62# Configure backend for pw_rpc_system_server. 63pw_set_backend(pw_rpc.system_server targets.host.system_rpc_server) 64# TODO(hepler): set config to use global mutex 65 66# Configure backend for pw_chrono's facades. 67pw_set_backend(pw_chrono.system_clock pw_chrono_stl.system_clock) 68pw_set_backend(pw_chrono.system_timer pw_chrono_stl.system_timer) 69 70# Configure backend for pw_perf_test's facade. 71pw_set_backend(pw_perf_test.TIMER_INTERFACE_BACKEND pw_perf_test.chrono_timer) 72 73# Configure backends for pw_thread's facades. 74pw_set_backend(pw_thread.id pw_thread_stl.id) 75pw_set_backend(pw_thread.yield pw_thread_stl.yield) 76pw_set_backend(pw_thread.sleep pw_thread_stl.sleep) 77pw_set_backend(pw_thread.thread pw_thread_stl.thread) 78pw_set_backend(pw_thread.test_thread_context pw_thread_stl.test_thread_context) 79pw_set_backend(pw_thread.thread_iteration pw_thread_stl.thread_iteration) 80 81# Configure backends for pw_system 82pw_set_backend(pw_system.target_hooks pw_system.stl_target_hooks) 83pw_set_backend(pw_system.rpc_server pw_system.hdlc_rpc_server) 84pw_set_backend(pw_system.io pw_system.sys_io_target_io) 85 86# Configure backends for pw_trace 87pw_set_backend(pw_trace pw_trace_tokenized) 88# Maybe this should just be a facade? 89set(pw_trace_tokenizer_time pw_trace_tokenized.host_trace_time CACHE STRING "Tokenizer trace time implementation" FORCE) 90 91set(pw_build_WARNINGS pw_build.strict_warnings pw_build.extra_strict_warnings 92 CACHE STRING "" FORCE) 93