From 22aa4975e5aceb410b700aacee7a22a78f0f8458 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Mon, 9 Dec 2024 11:25:13 -0700 Subject: [PATCH 1/2] :art: Split `lookup` into a separate library --- CMakeLists.txt | 41 +++++++++++++++++++++----------------- test/lookup/CMakeLists.txt | 4 ++-- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a9c7a30..92a523ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,28 @@ target_sources( include/interrupt/manager.hpp include/interrupt/policies.hpp) +add_library(cib_lookup INTERFACE) +target_compile_features(cib_lookup INTERFACE cxx_std_20) +target_link_libraries_system(cib_lookup INTERFACE stdx) + +target_sources( + cib_lookup + INTERFACE FILE_SET + lookup + TYPE + HEADERS + BASE_DIRS + include + FILES + include/lookup/detail/select.hpp + include/lookup/entry.hpp + include/lookup/input.hpp + include/lookup/linear_search_lookup.hpp + include/lookup/lookup.hpp + include/lookup/pseudo_pext_lookup.hpp + include/lookup/strategies.hpp + include/lookup/strategy_failed.hpp) + add_library(cib INTERFACE) target_compile_features(cib INTERFACE cxx_std_20) target_link_libraries_system( @@ -102,6 +124,7 @@ target_link_libraries_system( INTERFACE async cib_interrupt + cib_lookup cib_match cib_sc concurrency @@ -170,24 +193,6 @@ target_sources( include/log/level.hpp include/log/log.hpp) -target_sources( - cib - INTERFACE FILE_SET - lookup - TYPE - HEADERS - BASE_DIRS - include - FILES - include/lookup/detail/select.hpp - include/lookup/entry.hpp - include/lookup/input.hpp - include/lookup/linear_search_lookup.hpp - include/lookup/lookup.hpp - include/lookup/pseudo_pext_lookup.hpp - include/lookup/strategies.hpp - include/lookup/strategy_failed.hpp) - target_sources( cib INTERFACE FILE_SET diff --git a/test/lookup/CMakeLists.txt b/test/lookup/CMakeLists.txt index 611d808f..0c9a8afd 100644 --- a/test/lookup/CMakeLists.txt +++ b/test/lookup/CMakeLists.txt @@ -5,7 +5,7 @@ add_tests( pseudo_pext_lookup lookup LIBRARIES - cib) + cib_lookup) add_versioned_package("gh:boost-ext/mph#v1.0.8") add_versioned_package("gh:serge-sans-paille/frozen#292a811") @@ -78,7 +78,7 @@ foreach(BENCH_ALG_NAME ${BENCH_ALG_NAMES}) FILES pseudo_pext.cpp SYSTEM_LIBRARIES - cib + cib_lookup mph frozen-headers) target_compile_features(${name} PRIVATE cxx_std_23) From 54741fd20c6d21804d7e5268fe55046e753f4fe4 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Mon, 9 Dec 2024 11:35:29 -0700 Subject: [PATCH 2/2] :art: Split `log`, fmt and mipi impls into separate libraries --- CMakeLists.txt | 64 +++++++++++++++++++++++++++++++---------- test/log/CMakeLists.txt | 14 +++------ 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92a523ab..0b54b3ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,6 +117,38 @@ target_sources( include/lookup/strategies.hpp include/lookup/strategy_failed.hpp) +add_library(cib_log INTERFACE) +target_compile_features(cib_log INTERFACE cxx_std_20) +target_link_libraries_system(cib_log INTERFACE cib_sc stdx) + +target_sources( + cib_log + INTERFACE FILE_SET + log + TYPE + HEADERS + BASE_DIRS + include + FILES + include/log/level.hpp + include/log/log.hpp) + +add_library(cib_log_fmt INTERFACE) +target_compile_features(cib_log_fmt INTERFACE cxx_std_20) +target_link_libraries_system(cib_log_fmt INTERFACE cib_log fmt::fmt-header-only + stdx) + +target_sources( + cib_log_fmt + INTERFACE FILE_SET + log + TYPE + HEADERS + BASE_DIRS + include + FILES + include/log/fmt/logger.hpp) + add_library(cib INTERFACE) target_compile_features(cib INTERFACE cxx_std_20) target_link_libraries_system( @@ -178,21 +210,6 @@ target_sources( include/flow/run.hpp include/flow/step.hpp) -target_sources( - cib - INTERFACE FILE_SET - log - TYPE - HEADERS - BASE_DIRS - include - FILES - include/log/catalog/catalog.hpp - include/log/catalog/mipi_encoder.hpp - include/log/fmt/logger.hpp - include/log/level.hpp - include/log/log.hpp) - target_sources( cib INTERFACE FILE_SET @@ -231,6 +248,23 @@ target_sources( include/seq/impl.hpp include/seq/step.hpp) +add_library(cib_log_mipi INTERFACE) +target_compile_features(cib_log_mipi INTERFACE cxx_std_20) +target_link_libraries_system(cib_log_mipi INTERFACE cib cib_log concurrency + stdx) + +target_sources( + cib_log_mipi + INTERFACE FILE_SET + log + TYPE + HEADERS + BASE_DIRS + include + FILES + include/log/catalog/catalog.hpp + include/log/catalog/mipi_encoder.hpp) + if(PROJECT_IS_TOP_LEVEL) add_docs(docs) clang_tidy_interface(cib) diff --git a/test/log/CMakeLists.txt b/test/log/CMakeLists.txt index df8a11aa..228b136a 100644 --- a/test/log/CMakeLists.txt +++ b/test/log/CMakeLists.txt @@ -1,12 +1,6 @@ -add_tests( - FILES - fmt_logger - log - mipi_encoder - mipi_logger - module_id - LIBRARIES - cib) +add_tests(FILES log module_id LIBRARIES cib_log) +add_tests(FILES fmt_logger LIBRARIES cib_log_fmt) +add_tests(FILES mipi_encoder mipi_logger LIBRARIES cib_log_mipi) add_library(catalog1_lib STATIC catalog1_lib.cpp) add_library(catalog2_lib OBJECT catalog2a_lib.cpp catalog2b_lib.cpp) @@ -51,7 +45,7 @@ add_unit_test( catalog_app.cpp LIBRARIES warnings - cib + cib_log_mipi catalog1_lib catalog2_lib catalog_strings)