Skip to content

Commit a19a0a7

Browse files
committed
🎨 Split sc into a separate library
1 parent ba5f67c commit a19a0a7

File tree

11 files changed

+80
-27
lines changed

11 files changed

+80
-27
lines changed

CMakeLists.txt

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,34 @@ add_versioned_package("gh:intel/cpp-baremetal-concurrency#7c5b26c")
2828
add_versioned_package("gh:intel/cpp-std-extensions#2512bcf")
2929
add_versioned_package("gh:intel/cpp-baremetal-senders-and-receivers#73d95bc")
3030

31+
add_library(cib_sc INTERFACE)
32+
target_compile_features(cib_sc INTERFACE cxx_std_20)
33+
target_link_libraries_system(cib_sc INTERFACE fmt::fmt-header-only stdx)
34+
35+
target_sources(
36+
cib_sc
37+
INTERFACE FILE_SET
38+
sc
39+
TYPE
40+
HEADERS
41+
BASE_DIRS
42+
include
43+
FILES
44+
include/sc/format.hpp
45+
include/sc/fwd.hpp
46+
include/sc/lazy_string_format.hpp
47+
include/sc/string_constant.hpp)
48+
3149
add_library(cib INTERFACE)
3250
target_compile_features(cib INTERFACE cxx_std_20)
33-
target_link_libraries_system(cib INTERFACE async concurrency
34-
fmt::fmt-header-only stdx)
51+
target_link_libraries_system(
52+
cib
53+
INTERFACE
54+
async
55+
cib_sc
56+
concurrency
57+
fmt::fmt-header-only
58+
stdx)
3559

3660
target_sources(
3761
cib
@@ -179,20 +203,6 @@ target_sources(
179203
include/msg/send.hpp
180204
include/msg/service.hpp)
181205

182-
target_sources(
183-
cib
184-
INTERFACE FILE_SET
185-
sc
186-
TYPE
187-
HEADERS
188-
BASE_DIRS
189-
include
190-
FILES
191-
include/sc/format.hpp
192-
include/sc/fwd.hpp
193-
include/sc/lazy_string_format.hpp
194-
include/sc/string_constant.hpp)
195-
196206
target_sources(
197207
cib
198208
INTERFACE FILE_SET

test/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
function(add_tests)
2+
set(multiValueArgs FILES LIBRARIES)
3+
cmake_parse_arguments(AT "" "" "${multiValueArgs}" ${ARGN})
4+
25
get_filename_component(prefix ${CMAKE_CURRENT_SOURCE_DIR} NAME)
3-
foreach(name ${ARGN})
6+
foreach(name ${AT_FILES})
47
string(REPLACE "/" "_" test ${name})
58
add_unit_test(
69
"${prefix}_${test}_test"
@@ -9,7 +12,7 @@ function(add_tests)
912
"${name}.cpp"
1013
LIBRARIES
1114
warnings
12-
cib)
15+
${AT_LIBRARIES})
1316
endforeach()
1417
endfunction()
1518

test/cib/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
add_tests(builder_meta callback nexus readme_hello_world)
1+
add_tests(
2+
FILES
3+
builder_meta
4+
callback
5+
nexus
6+
readme_hello_world
7+
LIBRARIES
8+
cib)

test/flow/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ add_unit_test(
88
warnings
99
cib)
1010

11-
add_tests(flow graph graph_builder logging log_levels custom_log_levels)
11+
add_tests(
12+
FILES
13+
flow
14+
graph
15+
graph_builder
16+
logging
17+
log_levels
18+
custom_log_levels
19+
LIBRARIES
20+
cib)
1221

1322
add_subdirectory(fail)

test/interrupt/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
add_tests(
2+
FILES
23
dynamic_controller
34
irq_impl
45
manager
56
shared_irq_impl
67
shared_sub_irq_impl
78
sub_irq_impl
8-
policies)
9+
policies
10+
LIBRARIES
11+
cib)

test/log/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
add_tests(fmt_logger log mipi_encoder mipi_logger module_id)
1+
add_tests(
2+
FILES
3+
fmt_logger
4+
log
5+
mipi_encoder
6+
mipi_logger
7+
module_id
8+
LIBRARIES
9+
cib)
210

311
add_library(catalog1_lib STATIC catalog1_lib.cpp)
412
add_library(catalog2_lib OBJECT catalog2a_lib.cpp catalog2b_lib.cpp)

test/lookup/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
add_tests(input linear_search pseudo_pext_lookup lookup)
1+
add_tests(
2+
FILES
3+
input
4+
linear_search
5+
pseudo_pext_lookup
6+
lookup
7+
LIBRARIES
8+
cib)
29

310
add_versioned_package("gh:boost-ext/mph#v1.0.8")
411
add_versioned_package("gh:serge-sans-paille/frozen#292a811")

test/match/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_tests(
2+
FILES
23
and
34
constant
45
equivalence
@@ -10,4 +11,6 @@ add_tests(
1011
simplify_custom
1112
simplify_not
1213
simplify_or
13-
sum_of_products)
14+
sum_of_products
15+
LIBRARIES
16+
cib)

test/msg/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_tests(
2+
FILES
23
callback
34
field_extract
45
field_insert
@@ -9,7 +10,9 @@ add_tests(
910
indexed_callback
1011
indexed_handler
1112
message
12-
send)
13+
send
14+
LIBRARIES
15+
cib)
1316

1417
add_subdirectory(fail)
1518

test/sc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
add_tests(format string_constant)
1+
add_tests(FILES format string_constant LIBRARIES cib_sc)

0 commit comments

Comments
 (0)