Skip to content

Commit

Permalink
Accpet OsStr instead of str for flags (#1100)
Browse files Browse the repository at this point in the history
* Update `getenv` to return `Arc<Ostr>` instead of `Arc<str>`

It is possible that the environment variable contains non-utf8 charactes

Signed-off-by: Jiahao XU <[email protected]>

* Update `get_cpp_link_stdlib` to return `Result<Option<Cow<'_, Path>>, Error>`

Signed-off-by: Jiahao XU <[email protected]>

* Update `cpp_{set, link}_stdlib` to accept `Path` instead of `str`

Signed-off-by: Jiahao XU <[email protected]>

* Optimize `prefix_for_target` to ret `Cow<'static, str>`

Signed-off-by: Jiahao XU <[email protected]>

* Accept `impl AsRef<OsStr>` for asm, ar and cc/cxx flags and `link_lib_modifiers`

Signed-off-by: Jiahao XU <[email protected]>

* Improve debug logging in `getenv`

Signed-off-by: Jiahao XU <[email protected]>

* Revert deprecation

* Revert `cpp_{set, link}_stdlib` changes

Signed-off-by: Jiahao XU <[email protected]>

* Fix doc

Signed-off-by: Jiahao XU <[email protected]>

---------

Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu authored Jun 23, 2024
1 parent 7ff340c commit a1e291a
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 70 deletions.
Loading

0 comments on commit a1e291a

Please sign in to comment.