From bba3868b3b1dfd7741d33b119f73b5d342b9f1d5 Mon Sep 17 00:00:00 2001 From: pandaman Date: Wed, 13 May 2026 23:00:35 +0900 Subject: [PATCH] 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 --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b764dc260e..6199a89b8c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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()