fix: omit empty moreLeancArgs when leanc flags are unset (#13723)

This PR fixes toml_escape so it does not emit moreLeancArgs = [""] when
internal leanc flags are both empty (the combined placeholder was only
whitespace). This led GCC to see an extra empty argv entry and fail with
a confusing linker error.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pandaman 2026-05-13 23:00:35 +09:00 committed by GitHub
parent 6279ae98c7
commit bba3868b3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1064,8 +1064,8 @@ configure_file(${LEAN_SOURCE_DIR}/stdlib.make.in ${CMAKE_BINARY_DIR}/stdlib.make
# hacky
function(toml_escape IN OUTVAR)
if(IN)
string(STRIP "${IN}" OUT)
string(STRIP "${IN}" OUT)
if(OUT)
string(REPLACE " " "\", \"" OUT "${OUT}")
set(${OUTVAR} "\"${OUT}\"" PARENT_SCOPE)
endif()