File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,18 @@ compile_test_library(
8080file (READ "${PROJECT_SOURCE_DIR } /../resources/configurations/ddsrouter_config_schema.json"
8181 DDSROUTER_CONFIG_SCHEMA_CONTENT )
8282
83+ # Split into <=16000-char chunks to work around MSVC C2026 string literal size limit.
84+ # Adjacent string literals are concatenated by the compiler.
85+ string (LENGTH "${DDSROUTER_CONFIG_SCHEMA_CONTENT} " _schema_len)
86+ set (_chunk_size 16000)
87+ set (DDSROUTER_CONFIG_SCHEMA_CHUNKS "" )
88+ set (_offset 0)
89+ while (_offset LESS _schema_len)
90+ string (SUBSTRING "${DDSROUTER_CONFIG_SCHEMA_CONTENT} " ${_offset} ${_chunk_size} _chunk)
91+ string (APPEND DDSROUTER_CONFIG_SCHEMA_CHUNKS " R\" json(${_chunk} )json\"\n " )
92+ math (EXPR _offset "${_offset} + ${_chunk_size} " )
93+ endwhile ()
94+
8395configure_file (
8496 "${PROJECT_SOURCE_DIR } /include/ddsrouter_yaml/DdsRouterConfigSchema.hpp.in"
8597 "${CMAKE_CURRENT_BINARY_DIR } /include/ddsrouter_yaml/DdsRouterConfigSchema.hpp"
Original file line number Diff line number Diff line change 1414
1515#pragma once
1616
17- static const char* DDSROUTER_CONFIG_SCHEMA = R"json(@DDSROUTER_CONFIG_SCHEMA_CONTENT@)json";
17+ static const char* DDSROUTER_CONFIG_SCHEMA =
18+ @DDSROUTER_CONFIG_SCHEMA_CHUNKS@;
You can’t perform that action at this time.
0 commit comments