Skip to content

Commit 8a3cb0a

Browse files
feat(BILL-252): Add iOS Simulator arm64 support (#71)
## Summary Add support for Apple Silicon iOS simulators by properly detecting simulator targets and selecting the correct CouchbaseLite framework variant. ## Solution The fix checks the full `TARGET` environment variable for `"sim"` or `"x86_64"` to determine if it's a simulator build, and selects the appropriate framework: - **Device** (aarch64): `ios-arm64` - **Simulator** (aarch64 or x86_64): `ios-arm64_x86_64-simulator` ## Testing - ✅ Builds successfully for `aarch64-apple-ios-sim` target - ✅ Existing `x86_64-apple-ios` simulator builds still work - ✅ Device builds (`aarch64-apple-ios`) unaffected 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <[email protected]>
1 parent 6a3b1ae commit 8a3cb0a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

build.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,11 @@ fn configure_rustc() -> Result<(), Box<dyn Error>> {
210210
let target_os = env::var("CARGO_CFG_TARGET_OS")?;
211211
if target_os == "ios" {
212212
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").expect("Can't read target_arch");
213-
let ios_framework = match target_arch.as_str() {
214-
"aarch64" => "ios-arm64",
215-
"x86_64" => "ios-arm64_x86_64-simulator",
213+
// Check if this is a simulator target by looking at the full TARGET string
214+
let is_simulator = target_dir.contains("sim") || target_dir.contains("x86_64");
215+
let ios_framework = match (target_arch.as_str(), is_simulator) {
216+
("aarch64", false) => "ios-arm64",
217+
("aarch64", true) | ("x86_64", _) => "ios-arm64_x86_64-simulator",
216218
_ => panic!("Unsupported ios target"),
217219
};
218220

0 commit comments

Comments
 (0)