Improve detection of macOS deployment target, for choosing pmr implementation.#5027
Merged
Improve detection of macOS deployment target, for choosing pmr implementation.#5027
Conversation
teo-tsirpanis
commented
May 30, 2024
| message(STATUS "Using vendored cpp17::pmr for polymorphic allocators") | ||
| return() | ||
| endif() | ||
| if (APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET LESS 14) |
Member
Author
There was a problem hiding this comment.
Should LESS be VERSION_LESS? 🤔
Member
There was a problem hiding this comment.
I don't think so, that is for multi-component (dot separated) comparisons AFAICT
ihnorton
approved these changes
May 30, 2024
| message(STATUS "Using vendored cpp17::pmr for polymorphic allocators") | ||
| return() | ||
| endif() | ||
| if (APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET LESS 14) |
Member
There was a problem hiding this comment.
I don't think so, that is for multi-component (dot separated) comparisons AFAICT
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.
SC-48427
#4995 changed detection of
std::pmrfrom trying to run a C++ file referencing pmr APIs, to trying to compile it, which works in cross compilation scenarios and fixed Conda failures for reasons I do not understand.However in macOS versions prior to 14 the pmr headers exist, but binaries compiled with it fail ot run. There was already a check to force using the vendored pmr in such versions but it was defective, because it checked the
MACOS_DEPLOYMENT_TARGETenvironment variable, which might not exist. Before #4995, the runtime failure on these versions would be caught bytry_run. This PR updates the detection script to use theCMAKE_OSX_DEPLOYMENT_TARGETvariable, which gets automatically filled by CMake either from the aforementioned environment variable or automatically.TYPE: NO_HISTORY