Pin CMAKE_OSX_DEPLOYMENT_TARGET so the macOS floor is deliberate - #2575
Open
ZayanKhan-12 wants to merge 1 commit into
Open
Pin CMAKE_OSX_DEPLOYMENT_TARGET so the macOS floor is deliberate#2575ZayanKhan-12 wants to merge 1 commit into
ZayanKhan-12 wants to merge 1 commit into
Conversation
…Institute#2565) Nothing in the build set CMAKE_OSX_DEPLOYMENT_TARGET, so the deployment target of every binary defaulted to the OS/SDK of whichever machine ran the build, and symbols newer than that accidental floor linked cleanly but died at load time on older Macs (SCIInstitute#2564 was one instance). - Default the floor to 14.0 (oldest macOS in the CI matrix) as a cache variable set before the first PROJECT() call in both the Superbuild and src/ entry points; user-overridable, ignored off-Apple. - Forward it explicitly to every compiled ExternalProject: ExternalProject sub-builds do not inherit it. CMake-configured externals get a cache/arg entry; Boost additionally passes -mmacosx-version-min to the real b2 compile; CPython gets MACOSX_DEPLOYMENT_TARGET in its configure env, which configure bakes into its Makefile. - Add -Wunguarded-availability-new on APPLE so annotated post-floor API use fails loudly at compile time instead of at dyld load time. - Add a macOS CI step asserting the built binary's LC_BUILD_VERSION minos equals the pin, so a dropped flag is a red build, not a user crash report. Header-only externals (Eigen, GLM, SpdLog) and the WIN32-only Glew are unchanged; GoogleTestExternal.cmake is not referenced by the Superbuild. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
|
I'll have to examine this one carefully (not just with Claude 😉 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2565.
Nothing in the build set
CMAKE_OSX_DEPLOYMENT_TARGET, so the macOS floor of every binary was an accident of the build machine's OS/SDK, and post-floor symbols linked cleanly but failed at load time on older Macs — #2564 (quick_exit) was one instance.What this does
PROJECT()call in bothSuperbuild/CMakeLists.txtandsrc/CMakeLists.txt. Guarded onCMAKE_HOST_APPLE(the targetAPPLEvar doesn't exist beforeproject()); ignored off-Apple.ExternalProjectsub-builds do not inherit it:CMAKE_BUILD_TYPEforwarding.build_libsb2 step, so b2 additionally getscxxflags=/linkflags=-mmacosx-version-min=….MACOSX_DEPLOYMENT_TARGETis set in the configure env; configure bakes it into its Makefile so the build steps inherit it.GoogleTestExternal.cmakeis not referenced by the Superbuild, so it was left alone.-Wunguarded-availability-newto the APPLE warning set inSCIRUN_ADD_LIBRARY, so availability-annotated post-floor API use is a compile-time warning instead of a runtime dyld failure. (Honest caveat: it would not have caughtquick_exit, which the 15 SDK declares without availability annotations — but with the pin,__MAC_OS_X_VERSION_MIN_REQUIREDnow reads 140000 deterministically, which is what makes Fix dyld crash on macOS < 15 from unguarded quick_exit reference #2564's guard reliable.)LC_BUILD_VERSIONminosequals the pin, so a dropped flag shows up as a red build rather than a user crash report.Verification
CMAKE_OSX_DEPLOYMENT_TARGET:STRING=14.0lands in the top-level cache and in every generatedExternals/tmp/<name>_external-cache-Release.cmakeplus Tetgen's configure command.Note: touches the same
ExternalProject_Addblocks as the superbuild-caching residue on #2513 — happy to rebase whichever lands second.