mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The CMake function `get_effective_platform_for_triple` appears to only be used in one location: from within `escape_path_for_xcode`. The `get_effective_platform_for_triple` function's only purpose appears to be to check whether `SWIFT_HOST_TRIPLE` contains the string "macos", and if not, it emits an error. However, because on macOS hosts the build-script-impl is responsible for setting the `SWIFT_HOST_TRIPLE` variable, when `cmake -G Xcode` is invoked directly to configure the Swift project, this variable is unset, and so `get_effective_platform_for_triple` emits an error. I considered two solutions: 1. Have `swift/CMakeLists.txt` set a default `SWIFT_HOST_TRIPLE`, as it does for Linux. This would prevent `get_effective_platform_for_triple` from emitting an error. 2. Remove `get_effective_platform_for_triple` altogether. I chose (2) here. `get_effective_platform_for_triple` doesn't appear to do anything besides restrict the host platform arbitrarily. If users are somehow able to configure the project using `cmake -G Xcode` on Linux, shouldn't the Swift's CMake allow them to do so? Test plan: 1. Configure and build using Xcode and an in-tree Swift checkout. 2. Configure and build using `utils/build-script --xcode`.
5.6 KiB
5.6 KiB