@@ -221,6 +221,38 @@ wrapper function (`gen_str_catalog`)] that drives the process. See
221
221
https://github.com/intel/compile-time-init-build/blob/main/test/CMakeLists.txt[the
222
222
test] that exercises that functionality for an example.
223
223
224
+ `gen_str_catalog` is the CMake function that drives the string catalog generation.
225
+
226
+ [source,cpp]
227
+ ----
228
+ gen_str_catalog(
229
+ [GEN_STR_CATALOG <python-file>]
230
+ OUTPUT_CPP <output-cpp-file>
231
+ OUTPUT_JSON <output-json-file>
232
+ OUTPUT_XML <output-xml-file>
233
+ INPUT_LIBS <lib-files...>
234
+ INPUT_JSON <json-files...>
235
+ STABLE_JSON <json-files...>
236
+ INPUT_HEADERS <header-files...>
237
+ CLIENT_NAME <client-name>
238
+ VERSION <version>
239
+ GUID_ID <guid>
240
+ GUID_MASK <guid>
241
+ MODULE_ID_MAX <max-id>
242
+ OUTPUT_LIB <target-name>
243
+ OUTPUTS_TARGET <target-name>
244
+ [FORGET_OLD_IDS])
245
+ ----
246
+ - `INPUT_LIBS` is a required argument: this will be the input libraries from which the undefined symbols are extracted.
247
+ - `OUTPUT_{CPP,JSON,XML}` are the generated files. Also required.
248
+ - `INPUT_JSON` is optional extra JSON that will be copied verbatim into the generated JSON.
249
+ - `STABLE_JSON` is optional information about stable string and module IDs -- for example, from a previous build.
250
+ - `CLIENT_NAME`, `VERSION`, `GUID_ID` and `GUID_MASK` are all optional input fields for the MIPI-SyS-T XML.
251
+ - `MODULE_ID_MAX` is an optional upper bound on the assigned module IDs. This is useful to limit module ID bit-space.
252
+ - `OUTPUT_LIB` is an optional (`STATIC`) library target consisting of the `OUTPUT_CPP` file.
253
+ - `FORGET_OLD_IDS` is optional, and if present disregards the `STABLE_JSON` information.
254
+ - `GEN_STR_CATALOG` is optional, and allows pointing to a different python script.
255
+
224
256
=== Implementing a logger
225
257
226
258
Each logging implementation (configuration) provides a customization point: a
@@ -458,3 +490,20 @@ CIB_TRACE("Hello");
458
490
459
491
See the https://www.mipi.org/specifications/sys-t[MIPI Sys-T spec] for more
460
492
details.
493
+
494
+ === Examples/How-Tos
495
+
496
+ I want to...
497
+
498
+ - ...use the fmt logger...
499
+ * https://github.com/intel/compile-time-init-build/tree/main/examples/log/fmt_normal[...as my normal logger]
500
+ * https://github.com/intel/compile-time-init-build/tree/main/examples/log/fmt_tests[...in tests, to make sure my code logs correctly]
501
+ * https://github.com/intel/compile-time-init-build/tree/main/examples/log/fmt_multi[...to output to multiple places (stdout, file, etc)]
502
+ * https://github.com/intel/compile-time-init-build/tree/main/examples/log/fmt_custom_level[...with a custom level enumeration]
503
+ - ...use the binary logger...
504
+ * https://github.com/intel/compile-time-init-build/tree/main/examples/log/binary_normal[...as my normal logger]
505
+ * https://github.com/intel/compile-time-init-build/tree/main/examples/log/binary_custom[...with my own binary format]
506
+ * https://github.com/intel/compile-time-init-build/tree/main/examples/log/binary_stable_ids[...and keep string IDs stable from build to build]
507
+ * https://github.com/intel/compile-time-init-build/tree/main/examples/log/binary_fixed_id[...and fix a string ID in code]
508
+ - https://github.com/intel/compile-time-init-build/tree/main/examples/log/custom[...use my own logger]
509
+ - https://github.com/intel/compile-time-init-build/tree/main/examples/log/secure[...use a secure logger as well as a "normal" one]
0 commit comments