diff --git a/docs/file_format/custom_options.md b/docs/file_format/custom_options.md index 854fdda..7e28bde 100644 --- a/docs/file_format/custom_options.md +++ b/docs/file_format/custom_options.md @@ -68,6 +68,8 @@ like `base_path: build/ga{exam/ple}me/` is not valid, but `base_path: build/{example}/game/`, `base_path: build/ga{example}me/`, `target_path: build/{example}/game.{version}.elf` are valid. +All slinky paths support path replacement unless explicitely stated otherwise. + #### Example Say we have a yaml file like the following: diff --git a/docs/file_format/settings.md b/docs/file_format/settings.md index 55b050e..34f1f0a 100644 --- a/docs/file_format/settings.md +++ b/docs/file_format/settings.md @@ -99,7 +99,7 @@ as well. ## `base_path` All the emitted paths are relative to this path. Useful when all the files are -relative to the same path, like a `build` folder. +relative to the same directory, like a `build` folder. ### Example diff --git a/slinky/src/linker_writer.rs b/slinky/src/linker_writer.rs index 47324ad..0e57771 100644 --- a/slinky/src/linker_writer.rs +++ b/slinky/src/linker_writer.rs @@ -467,12 +467,15 @@ impl LinkerWriter<'_> { pub fn save_other_files(&self) -> Result<(), SlinkyError> { if let Some(d_path) = &self.d.settings.d_path { if let Some(target_path) = &self.d.settings.target_path { - self.export_dependencies_file_to_file(d_path, target_path)?; + self.export_dependencies_file_to_file( + &self.d.escape_path(d_path)?, + &self.d.escape_path(target_path)?, + )?; } } if let Some(symbols_header_path) = &self.d.settings.symbols_header_path { - self.export_symbol_header_to_file(symbols_header_path)?; + self.export_symbol_header_to_file(&self.d.escape_path(symbols_header_path)?)?; } Ok(())