Closed berendsliedrecht closed 1 year ago
I also hit this trying to compile a different crate for iOS.
This sets the CMAKE_OSX_SYSROOT to / and afterwards this code executes within cmake: This is the CMake code you listed, for reference: https://gitlab.kitware.com/cmake/cmake/-/blob/a50b2785129ec6c2eec2e4ac31f59f4592ec4df0/Modules/Platform/Darwin-Initialize.cmake#L298
After this code, this executes: https://gitlab.kitware.com/cmake/cmake/-/blob/a50b2785129ec6c2eec2e4ac31f59f4592ec4df0/Modules/Platform/iOS-Initialize.cmake#L3
It seems that the release of 0.1.49 caused this issue, likely from this PR: https://github.com/rust-lang/cmake-rs/pull/160
That doesn't look to me like it would have caused this, but #110 added the code you linked to set CMAKE_OSX_SYSROOT=/
. I'm not sure why that was added, honestly, it doesn't seem correct.
It seems that the release of 0.1.49 caused this issue
You're correct on this count, however. I was able to get past the cmake
portion of my build using version 0.1.48
of this crate.
Aha, it looks like #158 caused this issue! I assume that setting CMAKE_SYSTEM_NAME = iOS
makes cmake
use the code in iOS-Initialize.cmake
linked in my previous comment. Prior to that change it would not have.
That PR I created adds an iOS cross-compile test, which reproduces the failure here. I'm going to try simply removing that block of code that sets CMAKE_OSX_SYSROOT
for iOS. Cmake now has built-in support for cross-compiling to iOS. That was added in CMake 3.14, the release of which predates #110, but perhaps that version was not in widespread use at the time?
@blu3beri thanks for filing this issue with so much detail! It was helpful in figuring out a fix.
hi
I am currently trying to compile zeromq-src (0.1.10+4.3.2) and it seems to error that cmake can not find the iOS sdk.
aarch64-apple-ios
(or any apple-ios target)This part of the stack trace caught my eye:
After doing some digging in cmake-rs it seems to be related to this line here https://github.com/rust-lang/cmake-rs/blob/07cbf8fd36168b8a5dc9e107f6e659130dbcdd30/src/lib.rs.
This sets the
CMAKE_OSX_SYSROOT
to/
and afterwards this code executes within cmake:After this code, this executes:
I do not know almost anything about cmake, but this does seem very weird and I am unsure how I can resolve this.
Reproduce (on MacOS)
Happy to provide more information about my system where required.
Stacktrace
EDIT
It seems that the release of 0.1.49 caused this issue, likely from this PR: https://github.com/rust-lang/cmake-rs/pull/160