Changes required for rustc/cargo to build for iOS targets

This commit is contained in:
aspen 2020-06-30 17:21:49 -04:00
parent 16957bd4d3
commit e191358788
No known key found for this signature in database
GPG Key ID: 732932968965DE56
2 changed files with 13 additions and 0 deletions

View File

@ -811,6 +811,11 @@ impl Build {
if target.contains("apple-darwin") {
base.push("-stdlib=libc++".into());
}
// Required for LLVM to properly compile.
if target.contains("apple-ios") {
base.push("-miphoneos-version-min=10.0".into());
}
// Work around an apparently bad MinGW / GCC optimization,
// See: http://lists.llvm.org/pipermail/cfe-dev/2016-December/051980.html

View File

@ -175,6 +175,14 @@ impl Step for Llvm {
cfg.define("LLVM_ENABLE_ZLIB", "OFF");
}
// Are we compiling for iOS/tvOS?
if target.contains("apple") && !target.contains("darwin") {
cfg.define("CMAKE_OSX_SYSROOT", "/");
cfg.define("CMAKE_OSX_DEPLOYMENT_TARGET", "");
cfg.define("LLVM_ENABLE_PLUGINS", "OFF"); // Prevent cmake from adding -bundle to CFLAGS automatically.
cfg.define("LLVM_ENABLE_ZLIB", "OFF");
}
if builder.config.llvm_thin_lto {
cfg.define("LLVM_ENABLE_LTO", "Thin");
if !target.contains("apple") {