-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass C++ runtime lib when C++ toolchain declares it
Currently `rules_rust` won't link against the C++ standard library in case C++ toolchain is the `static_link_cpp_runtimes` feature (therefore when it uses `cc_toolchain.static_runtime_lib` and `cc_toolchain.dynamic_runtime_lib` attributes to declare which version of C++ static library should be linked into the final binary). This PR modifies `get_libs_for_static_executable` to also look into the C++ toolchain and depend on C++ standard library from there. Once we implement the support for dynamically linked rust binaries we will likely have an equivalend `get_libs_for_dynamic_executable`, which would then look into `cc_toolchain.dynamic_runtime_lib`. While there, I moved the `get_cc_toolchain` function to the `utils.rs`, to be consistent with the handling of the Rust toolchain.
- Loading branch information
Showing
4 changed files
with
60 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters