Open MarcTreySonos opened 11 months ago
Thanks for posting this PR, not sure if this project is maintained enough to pull it in, but this tipped me off on a more robust less invasive solution:
cmake-rs detects the CMAKE_TOOLCHAIN_FILE env var and will pass that file to cmake. This way I create a simple cmake toolchain file with set( CMAKE_OSX_SYSROOT "iphonesimulator" )
. Then if you run CMAKE_TOOLCHAIN_FILE=$PWD/toolchain.cmake cargo build --target x86_64-apple-ios
it will fixup the sysroot.
In addition, to simplify things further, I create a config.toml
and use configurable-env to set the var:
[env]
CMAKE_TOOLCHAIN_FILE = { value = "toolchain.cmake", relative = true }
Hope this helps any future discoverers.
when building for the simulator