Skip to content

Commit 56e0874

Browse files
authored
fix(cli): ios xcode-script arg parsing when using bun, closes #10742 (#11100)
1 parent d369e8d commit 56e0874

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

.changes/fix-bun-ios-usage.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'tauri-cli': 'patch:bug'
3+
'@tauri-apps/cli': 'patch:bug'
4+
---
5+
6+
Fix iOS xcode-script usage with `bun`.

crates/tauri-cli/src/mobile/ios/xcode_script.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212

1313
use anyhow::Context;
1414
use cargo_mobile2::{apple::target::Target, opts::Profile};
15-
use clap::Parser;
15+
use clap::{ArgAction, Parser};
1616
use object::{Object, ObjectSymbol};
1717

1818
use std::{
@@ -33,14 +33,14 @@ pub struct Options {
3333
#[clap(long)]
3434
sdk_root: PathBuf,
3535
/// Value of `FRAMEWORK_SEARCH_PATHS` env var
36-
#[clap(long)]
37-
framework_search_paths: String,
36+
#[clap(long, action = ArgAction::Append, num_args(0..))]
37+
framework_search_paths: Vec<String>,
3838
/// Value of `GCC_PREPROCESSOR_DEFINITIONS` env var
39-
#[clap(long)]
40-
gcc_preprocessor_definitions: String,
39+
#[clap(long, action = ArgAction::Append, num_args(0..))]
40+
gcc_preprocessor_definitions: Vec<String>,
4141
/// Value of `HEADER_SEARCH_PATHS` env var
42-
#[clap(long)]
43-
header_search_paths: String,
42+
#[clap(long, action = ArgAction::Append, num_args(0..))]
43+
header_search_paths: Vec<String>,
4444
/// Value of `CONFIGURATION` env var
4545
#[clap(long)]
4646
configuration: String,
@@ -149,15 +149,17 @@ pub fn command(options: Options) -> Result<()> {
149149
include_dir.as_os_str(),
150150
);
151151

152-
host_env.insert(
153-
"FRAMEWORK_SEARCH_PATHS",
154-
options.framework_search_paths.as_ref(),
155-
);
152+
let framework_search_paths = options.framework_search_paths.join(" ");
153+
host_env.insert("FRAMEWORK_SEARCH_PATHS", framework_search_paths.as_ref());
154+
155+
let gcc_preprocessor_definitions = options.gcc_preprocessor_definitions.join(" ");
156156
host_env.insert(
157157
"GCC_PREPROCESSOR_DEFINITIONS",
158-
options.gcc_preprocessor_definitions.as_ref(),
158+
gcc_preprocessor_definitions.as_ref(),
159159
);
160-
host_env.insert("HEADER_SEARCH_PATHS", options.header_search_paths.as_ref());
160+
161+
let header_search_paths = options.header_search_paths.join(" ");
162+
host_env.insert("HEADER_SEARCH_PATHS", header_search_paths.as_ref());
161163

162164
let macos_target = Target::macos();
163165

0 commit comments

Comments
 (0)