Skip to content

Commit

Permalink
Fix iOS target compilation. (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
aspen authored Feb 25, 2021
1 parent dee2a1b commit 22407b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,12 @@ impl Config {
if !self.defined("CMAKE_SYSTEM_NAME") {
cmd.arg("-DCMAKE_SYSTEM_NAME=SunOS");
}
} else if target.contains("apple-ios") || target.contains("apple-tvos") {
// These two flags prevent CMake from adding an OSX sysroot, which messes up compilation.
if !self.defined("CMAKE_OSX_SYSROOT") && !self.defined("CMAKE_OSX_DEPLOYMENT_TARGET") {
cmd.arg("-DCMAKE_OSX_SYSROOT=/");
cmd.arg("-DCMAKE_OSX_DEPLOYMENT_TARGET=");
}
}
if let Some(ref generator) = self.generator {
cmd.arg("-G").arg(generator);
Expand Down

0 comments on commit 22407b2

Please sign in to comment.