Skip to content

Commit 2b0d90c

Browse files
deps-cmake: a contract word with a space is quoted in the flags string, as CMake splits it
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent d82c89b commit 2b0d90c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎deps/cmake.cppm‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ inline std::string cmake_system_name(std::string_view os) {
139139
// The CMake code that reads the engine's contract for this configuration
140140
// (`${mcpp.contract}`, mcpp 2026.10.30.1+) into variables when the action
141141
// runs: `_mcpp_<c|cxx|asm>` and `_mcpp_ld` the programs, `_mcpp_<...>_flags`
142-
// their words joined, `_mcpp_ar` the archiver. Read then and not when this
142+
// their words joined (a word with a space quoted, as CMake splits a flags
143+
// string), `_mcpp_ar` the archiver. Read then and not when this
143144
// program plans: the engine writes the file after build programs have run.
144145
inline std::string contract_reader() {
145146
return R"(if(NOT EXISTS "${MCPP_CONTRACT}")
@@ -154,6 +155,9 @@ function(_mcpp_words out)
154155
math(EXPR _last "${_n} - 1")
155156
foreach(_i RANGE ${_last})
156157
string(JSON _a GET "${_mcpp_contract}" ${ARGN} ${_i})
158+
if(_a MATCHES " ")
159+
set(_a "\"${_a}\"")
160+
endif()
157161
string(APPEND _w " ${_a}")
158162
endforeach()
159163
endif()

0 commit comments

Comments
 (0)