Skip to content

Conversation

@edymtt
Copy link
Contributor

@edymtt edymtt commented Sep 6, 2022

This would be needed to compile on Apple Silicon, so that CMake does not
infer the wrong architecture when we want to build for Intel (see
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)

Addresses rdar://99587478

This would be needed to compile on Apple Silicon, so that CMake does not
infer the wrong architecture when we want to build for Intel (see
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)

Addresses rdar://99587478
@edymtt edymtt requested a review from artemcm September 6, 2022 08:00
@edymtt
Copy link
Contributor Author

edymtt commented Sep 6, 2022

@swift-ci please test

@azarovalex
Copy link
Contributor

@edymtt big thanks for trying to fix the toolchain build👍

I tried a similar fix while was trying to fix #1167 but for some reason, CMake didn't allow passing CMAKE_OSX_ARCHITECTURES flag to the project containing Swift sources, maybe something was wrong with my setup, I've just retested your solution and it works like a charm, I can close #1167.

Please note that this script has another problem I addressed here: #1168, this is not yet merged.

@edymtt edymtt linked an issue Sep 6, 2022 that may be closed by this pull request
@artemcm
Copy link
Contributor

artemcm commented Sep 6, 2022

@edymtt the CI here does not run the CMake build, so please verify it independently either locally or via cross-repo testing.

@edymtt
Copy link
Contributor Author

edymtt commented Sep 7, 2022

Did the verification both locally and at swiftlang/swift#60901

Checked that the generated toolchain is still building swift-driver fat

% lipo -archs Library/Developer/Toolchains/swift-PR-60901-291.xctoolchain/usr/bin/swift-driver
x86_64 arm64
% lipo -archs Library/Developer/Toolchains/swift-PR-60901-291.xctoolchain/usr/bin/swift-help  
x86_64 arm64

@edymtt edymtt merged commit e920166 into swiftlang:main Sep 7, 2022
@edymtt edymtt deleted the cmake_os_architectures_for_everyone branch September 8, 2022 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libCYaml.a has wrong arch on M1 Mac

3 participants