diff options
Diffstat (limited to 'pw_thread/CMakeLists.txt')
-rw-r--r-- | pw_thread/CMakeLists.txt | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/pw_thread/CMakeLists.txt b/pw_thread/CMakeLists.txt index 0ad8e33eb..dc16136bd 100644 --- a/pw_thread/CMakeLists.txt +++ b/pw_thread/CMakeLists.txt @@ -13,10 +13,11 @@ # the License. include($ENV{PW_ROOT}/pw_build/pigweed.cmake) +include($ENV{PW_ROOT}/pw_thread/backend.cmake) pw_add_module_config(pw_thread_CONFIG) -pw_add_module_library(pw_thread.config +pw_add_library(pw_thread.config INTERFACE HEADERS public/pw_thread/config.h PUBLIC_INCLUDES @@ -25,14 +26,18 @@ pw_add_module_library(pw_thread.config ${pw_thread_CONFIG} ) -pw_add_facade(pw_thread.id +pw_add_facade(pw_thread.id INTERFACE + BACKEND + pw_thread.id_BACKEND HEADERS public/pw_thread/id.h PUBLIC_INCLUDES public ) -pw_add_facade(pw_thread.sleep +pw_add_facade(pw_thread.sleep STATIC + BACKEND + pw_thread.sleep_BACKEND HEADERS public/pw_thread/sleep.h PUBLIC_INCLUDES @@ -44,7 +49,9 @@ pw_add_facade(pw_thread.sleep sleep.cc ) -pw_add_facade(pw_thread.thread +pw_add_facade(pw_thread.thread STATIC + BACKEND + pw_thread.thread_BACKEND HEADERS public/pw_thread/detached_thread.h public/pw_thread/thread.h @@ -57,14 +64,16 @@ pw_add_facade(pw_thread.thread thread.cc ) -pw_add_module_library(pw_thread.thread_core +pw_add_library(pw_thread.thread_core INTERFACE HEADERS public/pw_thread/thread_core.h PUBLIC_INCLUDES public ) -pw_add_facade(pw_thread.yield +pw_add_facade(pw_thread.yield STATIC + BACKEND + pw_thread.yield_BACKEND HEADERS public/pw_thread/yield.h PUBLIC_INCLUDES @@ -75,7 +84,7 @@ pw_add_facade(pw_thread.yield yield.cc ) -pw_add_module_library(pw_thread.snapshot +pw_add_library(pw_thread.snapshot STATIC HEADERS public/pw_thread/snapshot.h PUBLIC_INCLUDES @@ -100,11 +109,11 @@ pw_proto_library(pw_thread.protos pw_tokenizer.proto ) -if(NOT "${pw_thread.id_BACKEND}" STREQUAL "pw_thread.id.NO_BACKEND_SET") +if(NOT "${pw_thread.id_BACKEND}" STREQUAL "") pw_add_test(pw_thread.id_facade_test SOURCES id_facade_test.cc - DEPS + PRIVATE_DEPS pw_thread.id GROUPS modules @@ -112,13 +121,13 @@ if(NOT "${pw_thread.id_BACKEND}" STREQUAL "pw_thread.id.NO_BACKEND_SET") ) endif() -if((NOT "${pw_thread.id_BACKEND}" STREQUAL "pw_thread.id.NO_BACKEND_SET") AND - (NOT "${pw_thread.sleep_BACKEND}" STREQUAL "pw_thread.sleep.NO_BACKEND_SET")) +if((NOT "${pw_thread.id_BACKEND}" STREQUAL "") AND + (NOT "${pw_thread.sleep_BACKEND}" STREQUAL "")) pw_add_test(pw_thread.sleep_facade_test SOURCES sleep_facade_test.cc sleep_facade_test_c.c - DEPS + PRIVATE_DEPS pw_chrono.system_clock pw_thread.id pw_thread.sleep @@ -128,7 +137,7 @@ if((NOT "${pw_thread.id_BACKEND}" STREQUAL "pw_thread.id.NO_BACKEND_SET") AND ) endif() -pw_add_module_library(pw_thread.test_threads +pw_add_library(pw_thread.test_threads INTERFACE HEADERS public/pw_thread/test_threads.h PUBLIC_INCLUDES @@ -141,7 +150,7 @@ pw_add_module_library(pw_thread.test_threads # test_threads you can create a pw_add_test target which depends on this # target and a target which provides the implementation of # test_threads. See pw_thread_stl.thread_backend_test as an example. -pw_add_module_library(pw_thread.thread_facade_test +pw_add_library(pw_thread.thread_facade_test STATIC SOURCES thread_facade_test.cc PRIVATE_DEPS @@ -153,13 +162,13 @@ pw_add_module_library(pw_thread.thread_facade_test pw_unit_test ) -if((NOT "${pw_thread.id_BACKEND}" STREQUAL "pw_thread.id.NO_BACKEND_SET") AND - (NOT "${pw_thread.yield_BACKEND}" STREQUAL "pw_thread.yield.NO_BACKEND_SET")) +if((NOT "${pw_thread.id_BACKEND}" STREQUAL "") AND + (NOT "${pw_thread.yield_BACKEND}" STREQUAL "")) pw_add_test(pw_thread.yield_facade_test SOURCES yield_facade_test.cc yield_facade_test_c.c - DEPS + PRIVATE_DEPS pw_thread.id pw_thread.yield GROUPS |