-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathCMakeLists.txt
372 lines (337 loc) · 10.4 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
cmake_minimum_required(VERSION 3.25)
project(
cib
VERSION 0.1.0
LANGUAGES CXX
DESCRIPTION
"A header-only C++ library for composing modular firmware at compile-time."
HOMEPAGE_URL "https://github.com/intel/compile-time-init-build")
include(cmake/get_cpm.cmake)
if(PROJECT_IS_TOP_LEVEL)
cpmaddpackage("gh:intel/cicd-repo-infrastructure#dev")
else()
cpmaddpackage("gh:intel/cicd-repo-infrastructure#3e2bef0")
endif()
find_package(
Python3
COMPONENTS Interpreter
REQUIRED)
include(cmake/string_catalog.cmake)
add_versioned_package("gh:boostorg/mp11#boost-1.83.0")
fmt_recipe(10.2.1)
add_versioned_package("gh:intel/cpp-baremetal-concurrency#7c5b26c")
add_versioned_package("gh:intel/cpp-std-extensions#2834680")
add_versioned_package("gh:intel/cpp-baremetal-senders-and-receivers#73d95bc")
set(GEN_STR_CATALOG
${CMAKE_CURRENT_LIST_DIR}/tools/gen_str_catalog.py
CACHE FILEPATH "Location of script to generate a string catalog")
add_library(cib_sc INTERFACE)
target_compile_features(cib_sc INTERFACE cxx_std_20)
target_link_libraries_system(cib_sc INTERFACE fmt::fmt-header-only stdx)
target_sources(
cib_sc
INTERFACE FILE_SET
sc
TYPE
HEADERS
BASE_DIRS
include
FILES
include/sc/format.hpp
include/sc/fwd.hpp
include/sc/lazy_string_format.hpp
include/sc/string_constant.hpp)
add_library(cib_match INTERFACE)
target_compile_features(cib_match INTERFACE cxx_std_20)
target_link_libraries_system(cib_match INTERFACE cib_sc stdx)
target_sources(
cib_match
INTERFACE FILE_SET
match
TYPE
HEADERS
BASE_DIRS
include
FILES
include/match/and.hpp
include/match/bin_op.hpp
include/match/concepts.hpp
include/match/constant.hpp
include/match/cost.hpp
include/match/implies.hpp
include/match/negate.hpp
include/match/not.hpp
include/match/ops.hpp
include/match/or.hpp
include/match/predicate.hpp
include/match/simplify.hpp
include/match/sum_of_products.hpp)
add_library(cib_interrupt INTERFACE)
target_compile_features(cib_interrupt INTERFACE cxx_std_20)
target_link_libraries_system(cib_interrupt INTERFACE cib_sc concurrency stdx)
target_sources(
cib_interrupt
INTERFACE FILE_SET
interrupt
TYPE
HEADERS
BASE_DIRS
include
FILES
include/interrupt/concepts.hpp
include/interrupt/config.hpp
include/interrupt/dynamic_controller.hpp
include/interrupt/fwd.hpp
include/interrupt/hal.hpp
include/interrupt/impl.hpp
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_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/env.hpp
include/log/level.hpp
include/log/log.hpp
include/log/module.hpp)
add_library(cib_msg INTERFACE)
target_compile_features(cib_msg INTERFACE cxx_std_20)
target_link_libraries_system(
cib_msg
INTERFACE
async
cib_log
cib_lookup
cib_match
cib_sc
stdx)
target_sources(
cib_msg
INTERFACE FILE_SET
msg
TYPE
HEADERS
BASE_DIRS
include
FILES
include/msg/callback.hpp
include/msg/detail/indexed_builder_common.hpp
include/msg/detail/indexed_handler_common.hpp
include/msg/detail/separate_sum_terms.hpp
include/msg/field.hpp
include/msg/field_matchers.hpp
include/msg/handler_builder.hpp
include/msg/handler.hpp
include/msg/handler_interface.hpp
include/msg/indexed_builder.hpp
include/msg/indexed_handler.hpp
include/msg/indexed_service.hpp
include/msg/message.hpp
include/msg/send.hpp
include/msg/service.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_log_mipi INTERFACE)
target_compile_features(cib_log_mipi INTERFACE cxx_std_20)
target_link_libraries_system(cib_log_mipi INTERFACE cib_log cib_msg 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)
add_library(cib_nexus INTERFACE)
target_compile_features(cib_nexus INTERFACE cxx_std_20)
target_link_libraries_system(cib_nexus INTERFACE stdx)
target_sources(
cib_nexus
INTERFACE FILE_SET
nexus
TYPE
HEADERS
BASE_DIRS
include
FILES
include/cib/builder_meta.hpp
include/cib/built.hpp
include/cib/callback.hpp
include/cib/config.hpp
include/cib/detail/components.hpp
include/cib/detail/constexpr_conditional.hpp
include/cib/detail/runtime_conditional.hpp
include/cib/detail/config_details.hpp
include/cib/detail/config_item.hpp
include/cib/detail/exports.hpp
include/cib/detail/extend.hpp
include/cib/detail/nexus_details.hpp
include/cib/func_decl.hpp
include/cib/nexus.hpp)
add_library(cib_flow INTERFACE)
target_compile_features(cib_flow INTERFACE cxx_std_20)
target_link_libraries_system(cib_flow INTERFACE cib_log cib_nexus cib_sc stdx)
target_sources(
cib_flow
INTERFACE FILE_SET
flow
TYPE
HEADERS
BASE_DIRS
include
FILES
include/flow/builder.hpp
include/flow/common.hpp
include/flow/detail/par.hpp
include/flow/detail/seq.hpp
include/flow/detail/walk.hpp
include/flow/flow.hpp
include/flow/graph_builder.hpp
include/flow/graphviz_builder.hpp
include/flow/impl.hpp
include/flow/run.hpp
include/flow/step.hpp)
add_library(cib_seq INTERFACE)
target_compile_features(cib_seq INTERFACE cxx_std_20)
target_link_libraries_system(
cib_seq
INTERFACE
cib_flow
cib_log
cib_nexus
cib_sc
stdx)
target_sources(
cib_seq
INTERFACE FILE_SET
seq
TYPE
HEADERS
BASE_DIRS
include
FILES
include/seq/builder.hpp
include/seq/impl.hpp
include/seq/step.hpp)
add_library(cib INTERFACE)
target_compile_features(cib INTERFACE cxx_std_20)
target_link_libraries_system(
cib
INTERFACE
async
cib_flow
cib_interrupt
cib_log
cib_log_fmt
cib_log_mipi
cib_lookup
cib_match
cib_msg
cib_nexus
cib_sc
cib_seq
concurrency
fmt::fmt-header-only
stdx)
target_sources(
cib
INTERFACE FILE_SET
cib
TYPE
HEADERS
BASE_DIRS
include
FILES
include/cib/cib.hpp
include/cib/top.hpp)
if(PROJECT_IS_TOP_LEVEL)
add_docs(docs)
clang_tidy_interface(cib)
clang_tidy_interface(cib_flow)
clang_tidy_interface(cib_interrupt)
clang_tidy_interface(cib_lookup)
clang_tidy_interface(cib_log)
clang_tidy_interface(cib_log_fmt)
clang_tidy_interface(cib_log_mipi)
clang_tidy_interface(cib_match)
clang_tidy_interface(cib_msg)
clang_tidy_interface(cib_nexus)
clang_tidy_interface(cib_sc)
clang_tidy_interface(cib_seq)
# Enable functional and performance test suites.
add_subdirectory(test)
add_subdirectory(benchmark)
add_subdirectory(examples)
add_subdirectory(tools)
# Build single-header release.
include(cmake/single_header.cmake)
gen_single_header(
TARGET
release_header
GEN_HEADER
${CMAKE_SOURCE_DIR}/tools/gen_release_header.py
SOURCE_TARGET
cib
SOURCE_FILESET
cib
INPUT_HEADER
${CMAKE_SOURCE_DIR}/include/cib/cib.hpp
OUTPUT_HEADER
${CMAKE_BINARY_DIR}/include/cib/cib.hpp)
if(DEFINED ENV{SINGLE_HEADER})
add_dependencies(cib release_header)
target_include_directories(
cib
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/>)
else()
target_include_directories(
cib
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/>)
endif()
endif()