Skip to content

Commit

Permalink
fix(init): wrap .cargo/config.toml path in quotes (#296)
Browse files Browse the repository at this point in the history
* fix: build rustc path to `.cargo` couldn't contain spaces (fix #6627)

* remove unneeded to_string

* change file
  • Loading branch information
doricoding authored Mar 26, 2024
1 parent 590dbce commit ad41fe2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/rust-flags-path-quotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-mobile2": "patch"
---

Generate `.cargo/config.toml` with paths wrapped in quote.
7 changes: 4 additions & 3 deletions src/android/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ impl<'a> Target<'a> {
linker: Some(linker),
rustflags: vec![
"-L".to_owned(),
dunce::simplified(&config.app().prefix_path(".cargo"))
.display()
.to_string(),
format!(
"\"{}\"",
dunce::simplified(&config.app().prefix_path(".cargo")).display()
),
"-Clink-arg=-landroid".to_owned(),
"-Clink-arg=-llog".to_owned(),
"-Clink-arg=-lOpenSLES".to_owned(),
Expand Down

0 comments on commit ad41fe2

Please sign in to comment.