Skip to content

Commit 97413e5

Browse files
committed
🎨 Refactor cib library
Problem: - The dependency DAG between `cib` sub libraries is not well-defined. Solution: - Define it. Each library "level" depends on the level below. Level 0 libraries: - `async` - `conc` - `fmt` - `stdx` Level 1 libraries: - `cib_lookup` depends on `stdx` - `cib_nexus` depends on `stdx` - `cib_sc` depends on `fmt`, `stdx` Level 2 libraries: - `cib_log` depends on `cib_sc` - `cib_match` depends on `cib_sc` - `cib_interrupt` depends on `conc`, `cib_sc` Level 3 libraries: - `cib_flow` depends on `cib_log`, `cib_nexus`, `cib_sc` - `cib_log_fmt` depends on `cib_log` - `cib_msg` depends on `async`, `cib_log`, `cib_lookup`, `cib_match`, `cib_sc` Level 4 libraries: - `cib_log_mipi` depends on `conc`, `cib_log`, `cib_msg` - `cib_seq` depends on `cib_flow`, `cib_log`, `cib_nexus`, `cib_sc` Level 5 libraries: - `cib` depends on `cib_*` Note: - No code has moved, so includes remain valid. `cib` remains as an omnibus library. But this paves the way (if we want) to move code around and separate the libraries more.
1 parent bc71244 commit 97413e5

File tree

3 files changed

+61
-26
lines changed

3 files changed

+61
-26
lines changed

CMakeLists.txt

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -203,28 +203,14 @@ target_sources(
203203
include/log/catalog/catalog.hpp
204204
include/log/catalog/mipi_encoder.hpp)
205205

206-
add_library(cib INTERFACE)
207-
target_compile_features(cib INTERFACE cxx_std_20)
208-
target_link_libraries_system(
209-
cib
210-
INTERFACE
211-
async
212-
cib_interrupt
213-
cib_log
214-
cib_log_fmt
215-
cib_log_mipi
216-
cib_lookup
217-
cib_match
218-
cib_msg
219-
cib_sc
220-
concurrency
221-
fmt::fmt-header-only
222-
stdx)
206+
add_library(cib_nexus INTERFACE)
207+
target_compile_features(cib_nexus INTERFACE cxx_std_20)
208+
target_link_libraries_system(cib_nexus INTERFACE stdx)
223209

224210
target_sources(
225-
cib
211+
cib_nexus
226212
INTERFACE FILE_SET
227-
cib
213+
nexus
228214
TYPE
229215
HEADERS
230216
BASE_DIRS
@@ -233,7 +219,6 @@ target_sources(
233219
include/cib/builder_meta.hpp
234220
include/cib/built.hpp
235221
include/cib/callback.hpp
236-
include/cib/cib.hpp
237222
include/cib/config.hpp
238223
include/cib/detail/components.hpp
239224
include/cib/detail/constexpr_conditional.hpp
@@ -244,11 +229,14 @@ target_sources(
244229
include/cib/detail/extend.hpp
245230
include/cib/detail/nexus_details.hpp
246231
include/cib/func_decl.hpp
247-
include/cib/nexus.hpp
248-
include/cib/top.hpp)
232+
include/cib/nexus.hpp)
233+
234+
add_library(cib_flow INTERFACE)
235+
target_compile_features(cib_flow INTERFACE cxx_std_20)
236+
target_link_libraries_system(cib_flow INTERFACE cib_log cib_nexus cib_sc stdx)
249237

250238
target_sources(
251-
cib
239+
cib_flow
252240
INTERFACE FILE_SET
253241
flow
254242
TYPE
@@ -268,8 +256,19 @@ target_sources(
268256
include/flow/run.hpp
269257
include/flow/step.hpp)
270258

259+
add_library(cib_seq INTERFACE)
260+
target_compile_features(cib_seq INTERFACE cxx_std_20)
261+
target_link_libraries_system(
262+
cib_seq
263+
INTERFACE
264+
cib_flow
265+
cib_log
266+
cib_nexus
267+
cib_sc
268+
stdx)
269+
271270
target_sources(
272-
cib
271+
cib_seq
273272
INTERFACE FILE_SET
274273
seq
275274
TYPE
@@ -281,17 +280,53 @@ target_sources(
281280
include/seq/impl.hpp
282281
include/seq/step.hpp)
283282

283+
add_library(cib INTERFACE)
284+
target_compile_features(cib INTERFACE cxx_std_20)
285+
target_link_libraries_system(
286+
cib
287+
INTERFACE
288+
async
289+
cib_flow
290+
cib_interrupt
291+
cib_log
292+
cib_log_fmt
293+
cib_log_mipi
294+
cib_lookup
295+
cib_match
296+
cib_msg
297+
cib_nexus
298+
cib_sc
299+
cib_seq
300+
concurrency
301+
fmt::fmt-header-only
302+
stdx)
303+
304+
target_sources(
305+
cib
306+
INTERFACE FILE_SET
307+
cib
308+
TYPE
309+
HEADERS
310+
BASE_DIRS
311+
include
312+
FILES
313+
include/cib/cib.hpp
314+
include/cib/top.hpp)
315+
284316
if(PROJECT_IS_TOP_LEVEL)
285317
add_docs(docs)
286318
clang_tidy_interface(cib)
319+
clang_tidy_interface(cib_flow)
287320
clang_tidy_interface(cib_interrupt)
288321
clang_tidy_interface(cib_lookup)
289322
clang_tidy_interface(cib_log)
290323
clang_tidy_interface(cib_log_fmt)
291324
clang_tidy_interface(cib_log_mipi)
292325
clang_tidy_interface(cib_match)
293326
clang_tidy_interface(cib_msg)
327+
clang_tidy_interface(cib_nexus)
294328
clang_tidy_interface(cib_sc)
329+
clang_tidy_interface(cib_seq)
295330

296331
# Enable functional and performance test suites.
297332
add_subdirectory(test)

test/msg/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ add_tests(
1212
message
1313
send
1414
LIBRARIES
15-
cib_msg)
15+
cib)
1616

1717
add_subdirectory(fail)
1818

test/seq/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
add_tests(FILES sequencer LIBRARIES cib)
1+
add_tests(FILES sequencer LIBRARIES cib_seq)

0 commit comments

Comments
 (0)