-
Notifications
You must be signed in to change notification settings - Fork 10.6k
utils: Support multiple CMake versions in build.ps1 #84306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils: Support multiple CMake versions in build.ps1 #84306
Conversation
CMake 3.30 passes linker flags to the Swift invocation when it is used as the linker driver. However, Swift cannot parse the linker arguments, so they need to be passed with the `-Xlinker` prefix. This cannot be done uncondtionally as the same arguments are also used with the MSVC toolchain. CMake 4.0 introduces the CMP0181 policy, which allows CMake to parse the `LINKER:` syntax on the linker flags passed on the command line, which simplifies handling of flags. Note that building for Android still requires CMake 3.29 for the time being as we pass a linker driver argument to the CMake linker flags to override the linker used.
@swift-ci please test windows platform |
@swift-ci please test windows platform |
@swift-ci please test linux platform |
@swift-ci please test macos platform |
@swift-ci please smoke test linux platform |
@swift-ci please smoke test macos platform |
@swift-ci please smoke test linux platform |
1 similar comment
@swift-ci please smoke test linux platform |
@swift-ci please smoke test Linux platform |
1 similar comment
@swift-ci please smoke test Linux platform |
@swift-ci please test linux platform |
CMake 3.30 passes linker flags to the Swift invocation when it is used as the linker driver. However, Swift cannot parse the linker arguments, so they need to be passed with the
-Xlinker
prefix. This cannot be done uncondtionally as the same arguments are also used with the MSVC toolchain.CMake 4.0 introduces the CMP0181 policy, which allows CMake to parse the
LINKER:
syntax on the linker flags passed on the command line, which simplifies handling of flags.Note that building for Android still requires CMake 3.29 for the time being as we pass a linker driver argument to the CMake linker flags to override the linker used.