Skip to content

CMake: let users override the macOS deployment target - #9552

Open
tautschnig wants to merge 1 commit into
diffblue:developfrom
tautschnig:post-merge-fixups-9490
Open

tautschnig wants to merge 1 commit into
diffblue:developfrom
tautschnig:post-merge-fixups-9490

Conversation

@tautschnig

Copy link
Copy Markdown
Collaborator

CMakeLists.txt set CMAKE_OSX_DEPLOYMENT_TARGET as a normal variable after project(). A normal variable hides the cache entry of the same name, so neither -DCMAKE_OSX_DEPLOYMENT_TARGET=... nor the MACOSX_DEPLOYMENT_TARGET environment variable (which CMake only uses to seed that cache entry) had any effect: the hard-coded value always won. This is why the libc++ 22 build failure reported in #9489 could not be worked around without editing CMakeLists.txt, and why packagers' choice of target was silently replaced. CMake's documentation also asks for the variable to be set before the first project() call, as it is consulted while detecting the toolchain.

Make 11.0 a cache default that is set before project() and only applies when neither the cache variable nor the environment variable provides a value. On macOS, project() creates an empty cache entry when neither is given, so an empty value is treated as unset (and overwritten) to keep existing build directories on 11.0 rather than the compiler's default.

Also document the macOS 11.0 minimum in COMPILING.md, which never stated a minimum macOS version, and describe how to choose a newer deployment target. COMPILING.md also still suggested
-DCMAKE_OSX_ARCHITECTURES=i386;x86_64 for universal binaries, which cannot work: macOS dropped 32-bit support in 10.15, and the Make build's OSX_Universal configuration already builds for arm64 and x86_64. The example was also unquoted, so a shell would treat the ";" as a command separator. Finally, "On macOS >10.14" now covers every supported macOS version, so drop the version qualifier.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

CMakeLists.txt set CMAKE_OSX_DEPLOYMENT_TARGET as a normal variable
after project(). A normal variable hides the cache entry of the same
name, so neither -DCMAKE_OSX_DEPLOYMENT_TARGET=... nor the
MACOSX_DEPLOYMENT_TARGET environment variable (which CMake only uses to
seed that cache entry) had any effect: the hard-coded value always won.
This is why the libc++ 22 build failure reported in diffblue#9489 could not be
worked around without editing CMakeLists.txt, and why packagers' choice
of target was silently replaced. CMake's documentation also asks for the
variable to be set before the first project() call, as it is consulted
while detecting the toolchain.

Make 11.0 a cache default that is set before project() and only applies
when neither the cache variable nor the environment variable provides a
value. On macOS, project() creates an empty cache entry when neither is
given, so an empty value is treated as unset (and overwritten) to keep
existing build directories on 11.0 rather than the compiler's default.

Also document the macOS 11.0 minimum in COMPILING.md, which never stated
a minimum macOS version, and describe how to choose a newer deployment
target. COMPILING.md also still suggested
-DCMAKE_OSX_ARCHITECTURES=i386;x86_64 for universal binaries, which
cannot work: macOS dropped 32-bit support in 10.15, and the Make build's
OSX_Universal configuration already builds for arm64 and x86_64. The
example was also unquoted, so a shell would treat the ";" as a command
separator. Finally, "On macOS >10.14" now covers every supported macOS
version, so drop the version qualifier.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 11:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.27%. Comparing base (11135d7) to head (e3c9497).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9552      +/-   ##
===========================================
- Coverage    81.28%   81.27%   -0.01%     
===========================================
  Files         1725     1725              
  Lines       191618   191618              
  Branches        73       73              
===========================================
- Hits        155751   155741      -10     
- Misses       35867    35877      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants