From c69add958a7e59fbbe9f9ca5ad9c5b7e599971ef Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Apr 2025 10:16:29 -0400 Subject: [PATCH] Help: Add note about /usr/local/include on macOS without CMAKE_OSX_SYSROOT Issue: #19180 --- Help/release/4.0.rst | 6 ++++++ Help/variable/CMAKE_OSX_SYSROOT.rst | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/Help/release/4.0.rst b/Help/release/4.0.rst index c2f5c5419f..9d07559951 100644 --- a/Help/release/4.0.rst +++ b/Help/release/4.0.rst @@ -235,6 +235,12 @@ Other Changes does not do this, users must now specify :variable:`CMAKE_OSX_SYSROOT` when configuring their build, e.g., ``-DCMAKE_OSX_SYSROOT=macosx``. + Note that Xcode's compilers, when not invoked with ``-isysroot``, search + for headers in ``/usr/local/include`` before system SDK paths, matching the + convention on many platforms. Users on macOS-x86_64 hosts with Homebrew + installed in ``/usr/local`` should pass ``-DCMAKE_OSX_SYSROOT=macosx``, + or ``export SDKROOT=macosx``, when not building with Homebrew tools. + * On AIX, ``SHARED`` library targets now produce a shared library archive by default. See policy :policy:`CMP0182`. diff --git a/Help/variable/CMAKE_OSX_SYSROOT.rst b/Help/variable/CMAKE_OSX_SYSROOT.rst index db0d057388..bd2df5f190 100644 --- a/Help/variable/CMAKE_OSX_SYSROOT.rst +++ b/Help/variable/CMAKE_OSX_SYSROOT.rst @@ -15,4 +15,12 @@ sysroot is used. The default is now empty. Previously a default was computed based on the :variable:`CMAKE_OSX_DEPLOYMENT_TARGET` or the host platform. +.. note:: + + Xcode's compilers, when not invoked with ``-isysroot``, search for + headers in ``/usr/local/include`` before system SDK paths, matching the + convention on many platforms. Users on macOS-x86_64 hosts with Homebrew + installed in ``/usr/local`` should pass ``-DCMAKE_OSX_SYSROOT=macosx``, + or ``export SDKROOT=macosx``, when not building with Homebrew tools. + .. include:: CMAKE_OSX_VARIABLE.txt