Skip to content

Commit

Permalink
fix(cli): ios xcode-script arg parsing when using bun, closes #10742 (
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Sep 23, 2024
1 parent d369e8d commit 56e0874
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .changes/fix-bun-ios-usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'tauri-cli': 'patch:bug'
'@tauri-apps/cli': 'patch:bug'
---

Fix iOS xcode-script usage with `bun`.
28 changes: 15 additions & 13 deletions crates/tauri-cli/src/mobile/ios/xcode_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{

use anyhow::Context;
use cargo_mobile2::{apple::target::Target, opts::Profile};
use clap::Parser;
use clap::{ArgAction, Parser};
use object::{Object, ObjectSymbol};

use std::{
Expand All @@ -33,14 +33,14 @@ pub struct Options {
#[clap(long)]
sdk_root: PathBuf,
/// Value of `FRAMEWORK_SEARCH_PATHS` env var
#[clap(long)]
framework_search_paths: String,
#[clap(long, action = ArgAction::Append, num_args(0..))]
framework_search_paths: Vec<String>,
/// Value of `GCC_PREPROCESSOR_DEFINITIONS` env var
#[clap(long)]
gcc_preprocessor_definitions: String,
#[clap(long, action = ArgAction::Append, num_args(0..))]
gcc_preprocessor_definitions: Vec<String>,
/// Value of `HEADER_SEARCH_PATHS` env var
#[clap(long)]
header_search_paths: String,
#[clap(long, action = ArgAction::Append, num_args(0..))]
header_search_paths: Vec<String>,
/// Value of `CONFIGURATION` env var
#[clap(long)]
configuration: String,
Expand Down Expand Up @@ -149,15 +149,17 @@ pub fn command(options: Options) -> Result<()> {
include_dir.as_os_str(),
);

host_env.insert(
"FRAMEWORK_SEARCH_PATHS",
options.framework_search_paths.as_ref(),
);
let framework_search_paths = options.framework_search_paths.join(" ");
host_env.insert("FRAMEWORK_SEARCH_PATHS", framework_search_paths.as_ref());

let gcc_preprocessor_definitions = options.gcc_preprocessor_definitions.join(" ");
host_env.insert(
"GCC_PREPROCESSOR_DEFINITIONS",
options.gcc_preprocessor_definitions.as_ref(),
gcc_preprocessor_definitions.as_ref(),
);
host_env.insert("HEADER_SEARCH_PATHS", options.header_search_paths.as_ref());

let header_search_paths = options.header_search_paths.join(" ");
host_env.insert("HEADER_SEARCH_PATHS", header_search_paths.as_ref());

let macos_target = Target::macos();

Expand Down

0 comments on commit 56e0874

Please sign in to comment.