Skip to content

Commit eb8b788

Browse files
authored
Merge pull request #670 from elbeno/default-gen-str
🎨 Allow GEN_STR_CATALOG to be defaulted
2 parents 9b0e790 + 76fca0f commit eb8b788

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CMakeLists.txt

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

31+
set(GEN_STR_CATALOG
32+
${CMAKE_CURRENT_LIST_DIR}/tools/gen_str_catalog.py
33+
CACHE FILEPATH "Location of script to generate a string catalog")
34+
3135
add_library(cib_sc INTERFACE)
3236
target_compile_features(cib_sc INTERFACE cxx_std_20)
3337
target_link_libraries_system(cib_sc INTERFACE fmt::fmt-header-only stdx)

cmake/string_catalog.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ function(gen_str_catalog)
6363
if(SC_GUID_MASK)
6464
set(GUID_MASK_ARG --guid_mask ${SC_GUID_MASK})
6565
endif()
66+
if(NOT SC_GEN_STR_CATALOG)
67+
set(SC_GEN_STR_CATALOG ${GEN_STR_CATALOG})
68+
endif()
6669

6770
add_custom_command(
6871
OUTPUT ${SC_OUTPUT_CPP} ${SC_OUTPUT_JSON} ${SC_OUTPUT_XML}

test/log/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ target_include_directories(catalog2_lib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
99
target_link_libraries(catalog1_lib PRIVATE warnings cib)
1010
target_link_libraries(catalog2_lib PRIVATE warnings cib)
1111
gen_str_catalog(
12-
GEN_STR_CATALOG
13-
${CMAKE_SOURCE_DIR}/tools/gen_str_catalog.py
1412
OUTPUT_CPP
1513
${CMAKE_CURRENT_BINARY_DIR}/strings.cpp
1614
OUTPUT_JSON

0 commit comments

Comments
 (0)