From 3343ee971b6dd94bb7d1c522652d19498fff3ded Mon Sep 17 00:00:00 2001 From: MinimalEffort07 <90430937+MinimalEffort07@users.noreply.github.com> Date: Sun, 17 Aug 2025 05:25:34 +1000 Subject: [PATCH] build(deps): CMake generation fails when path contains spaces #35332 Problem: Additional include directories in DEPS_INCLUDE_FLAGS variable are not quoted. Paths with spaces break the resulting compile command. Solution: Enclose values in double quotes. Note: normally we should avoid manual quoting, but in this case we can't because of how `DEPS_INCLUDE_FLAGS` is used in `BuildLuv.cmake` and `BuildLpeg.cmake`. (cherry picked from commit 77860f541812348c98e0733678387d1715fc6b23) --- cmake.deps/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake.deps/CMakeLists.txt b/cmake.deps/CMakeLists.txt index ff75bd729c..4189eb4442 100644 --- a/cmake.deps/CMakeLists.txt +++ b/cmake.deps/CMakeLists.txt @@ -73,7 +73,7 @@ if(HAS_OG_FLAG) set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS}) endif() -set(DEPS_INCLUDE_FLAGS "-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1") +set(DEPS_INCLUDE_FLAGS "-I\"${DEPS_INSTALL_DIR}/include\" -I\"${DEPS_INSTALL_DIR}/include/luajit-2.1\"") # If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET), # fall back to local system version. Needs to be done here and in top-level CMakeLists.txt. @@ -96,10 +96,10 @@ else() find_package(Lua 5.1 EXACT) if(LUAJIT_FOUND) set(LUA_ENGINE LuaJit) - string(APPEND DEPS_INCLUDE_FLAGS " -I${LUAJIT_INCLUDE_DIR}") + string(APPEND DEPS_INCLUDE_FLAGS " -I\"${LUAJIT_INCLUDE_DIR}\"") elseif(LUA_FOUND) set(LUA_ENGINE Lua) - string(APPEND DEPS_INCLUDE_FLAGS " -I${LUA_INCLUDE_DIR}") + string(APPEND DEPS_INCLUDE_FLAGS " -I\"${LUA_INCLUDE_DIR}\"") else() message(FATAL_ERROR "Could not find system lua or luajit") endif()