Skip to content

Commit ca2f48c

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 `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 ca2f48c

File tree

1 file changed

+56
-24
lines changed

1 file changed

+56
-24
lines changed

CMakeLists.txt

Lines changed: 56 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,6 +280,39 @@ 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)

0 commit comments

Comments
 (0)