mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
Apple: Fix mapping CMAKE_APPLE_ARCH_SYSROOTS to custom OSX_ARCHITECTURES
The `CMAKE_OSX_ARCHITECTURES` value is not used directly by generators. It is used to initialize a per-target `OSX_ARCHITECTURES` property, but that property can also be set explicitly by project code to a subset of the full list of architectures. In order to handle this case, construct a mapping from each `CMAKE_OSX_ARCHITECTURES` entry to the corresponding `CMAKE_APPLE_ARCH_SYSROOTS` entry by name. Use the mapping to find the sysroot for each entry in `OSX_ARCHITECTURES` for a given target. If `CMAKE_APPLE_ARCH_SYSROOTS` does not have the same length as `CMAKE_OSX_ARCHITECTURES`, error out early rather than risking a crash or assertion failure. Fixes: #20534
This commit is contained in:
@@ -513,6 +513,7 @@ protected:
|
||||
std::map<std::string, std::string> VariableMappings;
|
||||
std::string CompilerSysroot;
|
||||
std::string LinkerSysroot;
|
||||
std::unordered_map<std::string, std::string> AppleArchSysroots;
|
||||
|
||||
bool EmitUniversalBinaryFlags;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user