From f6a9a1d63a3f05ac97ed2adbc6cdd7b95515b7e4 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 19 Jul 2026 14:44:28 +0000 Subject: [PATCH 33/71] fix(macos): pass the frontend -I as separate tokens (gcc-4.2 custom command) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gcc-4.2 custom command emitted -I"path" as a single VERBATIM token, so the compiler received the include directory with literal quotes and could not find contour_macos/TerminalView.h. Pass -I and the path as separate list elements so CMake quotes only when needed. The frontend .mm files pull only system headers (AppKit/ApplicationServices/ etc., via the SDK) plus our own src for SessionBridge.h/TerminalView.h, so a single -I is the complete include set — no /opt/local/include or LegacySupport (those are modern-gcc/engine scaffolding the .mm do not need). Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01AeG2jwYMX5gdvvtUnx3PJa --- src/contour_macos/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/contour_macos/CMakeLists.txt b/src/contour_macos/CMakeLists.txt index 7987bc99..6fe7abc1 100644 --- a/src/contour_macos/CMakeLists.txt +++ b/src/contour_macos/CMakeLists.txt @@ -91,6 +91,11 @@ Empty = use the modern default OBJCXX compiler.") list(APPEND _fe_flags -isysroot "${CMAKE_OSX_SYSROOT}") endif() + # Our own header roots so #include resolves. Pass -I and the path + # as SEPARATE tokens: a combined -I"path" under VERBATIM is emitted with literal + # quotes, which the compiler then treats as part of the directory name. + set(_fe_includes -I "${PROJECT_SOURCE_DIR}/src") + set(_app_objs "") foreach(_mm IN LISTS _app_mm) get_filename_component(_name "${_mm}" NAME_WE) @@ -102,8 +107,7 @@ Empty = use the modern default OBJCXX compiler.") -std=${CONTOUR_MACOS_OBJCXX_STD} ${_fe_flags} -O2 -DNDEBUG - -I"${PROJECT_SOURCE_DIR}/src" - -I"${CMAKE_SOURCE_DIR}/src" + ${_fe_includes} -c "${_mm}" -o "${_obj}" DEPENDS "${_mm}" ${_app_headers}