-
Notifications
You must be signed in to change notification settings - Fork 125
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
Improve cross compiling support #158
Conversation
src/lib.rs
Outdated
} | ||
} else if target.contains("solaris") { | ||
if !self.defined("CMAKE_SYSTEM_NAME") { | ||
self.define("CMAKE_SYSTEM_NAME", "SunOS"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thanks for improving the CI too.
…Fixes rust-lang#173 In rust-lang#158, better support for using CMake's cross-compilation facilities was added. This made the workaround added in rust-lang#110 for iOS not only unnecessary, but actively harmful, in that it runs afoul of SDK validation checks in the CMake iOS codepath.
* add an iOS cross-compile test to CI * Fix zlib-ng compilation for iOS * Revert #110 to fix iOS cross-compilation after #158. Fixes #173 In #158, better support for using CMake's cross-compilation facilities was added. This made the workaround added in #110 for iOS not only unnecessary, but actively harmful, in that it runs afoul of SDK validation checks in the CMake iOS codepath. * Use checkout@v3 Co-authored-by: Yuki Okushi <jtitor@2k36.org> --------- Co-authored-by: Thom Chiovoloni <thom@shift.click> Co-authored-by: Yuki Okushi <jtitor@2k36.org>
I'm afraid this broke no-toolchain cross-compilation using Visual Studio, from an x86_64 Windows host to aarch64-pc-windows-msvc. Things are a bit clunky there in general (the existing support goes through platforms and does not set (Specifically, the auto-search for |
Workaround: set |
Turns out this also broke cross-compiling to Mac Catalyst targets ( EDIT (months later): here's CMake not deciding what to do about Catalyst, which isn't cmake-rs's fault. |
This PR changes
cmake-rs
to fill outCMAKE_SYSTEM_NAME
andCMAKE_SYSTEM_PROCESSOR
basedCARGO_CFG_TARGET_OS
andCARGO_CFG_TARGET_ARCH
when cross compiling whileCMAKE_TOOLCHAIN_FILE
andCMAKE_SYSTEM_NAME
isn't set by user.It's tested on CI using
cross
.Closes #75
Closes #80
Closes #151