Skip to content

Commit 22407b2

Browse files
author
aspen
authored
Fix iOS target compilation. (#110)
1 parent dee2a1b commit 22407b2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,12 @@ impl Config {
562562
if !self.defined("CMAKE_SYSTEM_NAME") {
563563
cmd.arg("-DCMAKE_SYSTEM_NAME=SunOS");
564564
}
565+
} else if target.contains("apple-ios") || target.contains("apple-tvos") {
566+
// These two flags prevent CMake from adding an OSX sysroot, which messes up compilation.
567+
if !self.defined("CMAKE_OSX_SYSROOT") && !self.defined("CMAKE_OSX_DEPLOYMENT_TARGET") {
568+
cmd.arg("-DCMAKE_OSX_SYSROOT=/");
569+
cmd.arg("-DCMAKE_OSX_DEPLOYMENT_TARGET=");
570+
}
565571
}
566572
if let Some(ref generator) = self.generator {
567573
cmd.arg("-G").arg(generator);

0 commit comments

Comments
 (0)