From e6ccfee46fac654fda2e9ab4393e572b6e56e6f7 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 21 Jul 2026 14:01:15 +0000 Subject: [PATCH 01/71] build(macos): add CONTOUR_FRONTEND_MACOS option and Qt-exclusion gate CMake: add a CONTOUR_FRONTEND_MACOS option (requires an Apple target, and is mutually exclusive with the Qt6 GUI). Split from the original commit c0ffa9638 (upstream-history split into vendor/frontend layers, 2026-07-21): the accompanying vtpty strerror_r fix and the -fexperimental-library Clang-only guard are vendor-layer changes to files/lines upstream owns unconditionally; this hunk is purely additive inside our own option/if(CONTOUR_FRONTEND_MACOS) guard. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01LzTmVgP2ruMz987VJ78k77 --- CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e9adbd8..13d10dbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,8 @@ endif() option(CONTOUR_TESTING "Enables building of unittests for libterminal [default: ${MAINTAINER_MODE}]" ${MAINTAINER_MODE}) option(CONTOUR_VERIFY_STATE "Enables expensive internal terminal-state invariant checks (Grid/Terminal verifyState) [default: ${MAINTAINER_MODE}]" ${MAINTAINER_MODE}) -option(CONTOUR_FRONTEND_GUI "Enables GUI frontend." ON) +option(CONTOUR_FRONTEND_GUI "Enables the Qt6 GUI frontend." ON) +option(CONTOUR_FRONTEND_MACOS "Enables the native AppKit/CoreGraphics macOS frontend (no Qt)." OFF) option(CONTOUR_COVERAGE "Builds with codecov [default: OFF]" OFF) option(CONTOUR_SANITIZE "Builds with Address sanitizer enabled [default: OFF]" "OFF") option(CONTOUR_STACKTRACE_ADDR2LINE "Uses addr2line to pretty-print SEGV stacktrace." ${ADDR2LINE_DEFAULT}) @@ -111,6 +112,18 @@ option(CONTOUR_WITH_UTEMPTER "Build with utempter support [default: ON]" ON) option(CONTOUR_USE_CPM "Use CPM to fetch dependencies [default: ON]" ON) option(CONTOUR_BUILD_STATIC "Link to static libraries [default: OFF]" OFF) option(CONTOUR_BUILD_NATIVE "Build for native architecture [default: OFF]" OFF) + +# The native macOS frontend replaces the Qt6 GUI; the two are mutually exclusive. +if(CONTOUR_FRONTEND_MACOS) + if(NOT APPLE) + message(FATAL_ERROR "CONTOUR_FRONTEND_MACOS requires an Apple (macOS) target.") + endif() + if(CONTOUR_FRONTEND_GUI) + message(STATUS "CONTOUR_FRONTEND_MACOS is ON; forcing CONTOUR_FRONTEND_GUI OFF (no Qt).") + set(CONTOUR_FRONTEND_GUI OFF CACHE BOOL "Enables the Qt6 GUI frontend." FORCE) + endif() +endif() + if(CONTOUR_BUILD_STATIC) set(BUILD_SHARED_LIBS OFF) set(CMAKE_POSITION_INDEPENDENT_CODE ON)