|
@@ -134,13 +134,22 @@ pub fn command(options: Options) -> Result<()> {
|
|
|
|
|
|
let tauri_config = get_config(None)?;
|
|
|
|
|
|
- for arch in options.arches {
|
|
|
+ // when using Xcode, the arches will be ['Simulator', 'arm64'] instead of ['arm64-sim']
|
|
|
+ let arches = if options.arches.contains(&"Simulator".into()) {
|
|
|
+ vec![if cfg!(target_arch = "aarch64") {
|
|
|
+ "arm64-sim".to_string()
|
|
|
+ } else {
|
|
|
+ "x86_64".to_string()
|
|
|
+ }]
|
|
|
+ } else {
|
|
|
+ options.arches
|
|
|
+ };
|
|
|
+ for arch in arches {
|
|
|
// Set target-specific flags
|
|
|
let (env_triple, rust_triple) = match arch.as_str() {
|
|
|
"arm64" => ("aarch64_apple_ios", "aarch64-apple-ios"),
|
|
|
"arm64-sim" => ("aarch64_apple_ios_sim", "aarch64-apple-ios-sim"),
|
|
|
"x86_64" => ("x86_64_apple_ios", "x86_64-apple-ios"),
|
|
|
- "Simulator" => continue,
|
|
|
_ => {
|
|
|
return Err(anyhow::anyhow!(
|
|
|
"Arch specified by Xcode was invalid. {} isn't a known arch",
|
|
@@ -196,13 +205,13 @@ pub fn command(options: Options) -> Result<()> {
|
|
|
return Err(anyhow::anyhow!("Library not found at {}. Make sure your Cargo.toml file has a [lib] block with `crate-type = [\"staticlib\", \"cdylib\", \"rlib\"]`", lib_path.display()));
|
|
|
}
|
|
|
std::fs::create_dir_all(format!(
|
|
|
- "gen/apple/Externals/{rust_triple}/{}",
|
|
|
+ "gen/apple/Externals/{}",
|
|
|
profile.as_str()
|
|
|
))?;
|
|
|
std::fs::copy(
|
|
|
lib_path,
|
|
|
format!(
|
|
|
- "gen/apple/Externals/{rust_triple}/{}/lib{}.a",
|
|
|
+ "gen/apple/Externals/{}/lib{}.a",
|
|
|
profile.as_str(),
|
|
|
config.app().lib_name()
|
|
|
),
|