diff --git a/libraries/protocol/get_config.d/generate_get_config.cmake b/libraries/protocol/get_config.d/generate_get_config.cmake index 0233b18407..4c3d3ca163 100644 --- a/libraries/protocol/get_config.d/generate_get_config.cmake +++ b/libraries/protocol/get_config.d/generate_get_config.cmake @@ -5,6 +5,9 @@ macro(generate_get_config path_to_config_hpp get_config_cpp_in get_config_cpp_ou # removing includes and pragmas file(STRINGS ${path_to_new_config_hpp} file_content ) + get_filename_component(file_extension "${get_config_cpp_out}" EXT) + string(SUBSTRING "${file_extension}" 1 -1 file_extension) + string(TOLOWER "${file_extension}" file_extension) list(FILTER file_content EXCLUDE REGEX "#(include|pragma)" ) set(prepared_get_content) foreach(x ${file_content}) @@ -55,7 +58,13 @@ macro(generate_get_config path_to_config_hpp get_config_cpp_in get_config_cpp_ou string(REGEX REPLACE "#define ([A-Z0-9_]+) .*" "\\1" UNSAFE_VALUE "${line}") string(STRIP ${UNSAFE_VALUE} VALUE) if( NOT ${VALUE} STREQUAL "HIVE_CHAIN_ID" ) - list( APPEND list_of_new_lines " result[\"${VALUE}\"] = ${VALUE}\;\n" ) + if ("${file_extension}" STREQUAL "cpp") + list( APPEND list_of_new_lines " result[\"${VALUE}\"] = ${VALUE}\;\n" ) + elseif ("${file_extension}" STREQUAL "ts") + list( APPEND list_of_new_lines " \"${VALUE}\": string\;\n" ) + else() + message(FATAL_ERROR "Unsupported language detected for get_config file generation: ${file_extension}") + endif() endif() endif() endforeach()