about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-05-29 18:00:14 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-05-29 18:00:14 +0200
commit301d7229f706cbb95e78cd2319148bcbf22d80a1 (patch)
tree96a2ebc3203d366138f8d5696124fd009fa1d555 /src
parentde1d0e0da9a93d2881b0416b05423c63488c2343 (diff)
downloadrust-301d7229f706cbb95e78cd2319148bcbf22d80a1.tar.gz
rust-301d7229f706cbb95e78cd2319148bcbf22d80a1.zip
Add `run-make-support::rust_lib_name`
Diffstat (limited to 'src')
-rw-r--r--src/tools/run-make-support/src/lib.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
index d96c8b89127..c7f48ad3f19 100644
--- a/src/tools/run-make-support/src/lib.rs
+++ b/src/tools/run-make-support/src/lib.rs
@@ -135,7 +135,13 @@ pub fn dynamic_lib_name(name: &str) -> String {
 /// Construct a path to a rust library (rlib) under `$TMPDIR` given the library name. This will return a
 /// path with `$TMPDIR` joined with the library name.
 pub fn rust_lib(name: &str) -> PathBuf {
-    tmp_dir().join(format!("lib{name}.rlib"))
+    tmp_dir().join(rust_lib_name(name))
+}
+
+/// Generate the name a rust library (rlib) would have. If you want the complete path, use
+/// [`rust_lib`] instead.
+pub fn rust_lib_name(name: &str) -> String {
+    format!("lib{name}.rlib")
 }
 
 /// Construct the binary name based on platform.