@@ -35,6 +35,10 @@ pub fn tmp_dir() -> PathBuf {
3535 env:: var_os ( "TMPDIR" ) . unwrap ( ) . into ( )
3636}
3737
38+ pub fn tmp_path < P : AsRef < Path > > ( path : P ) -> PathBuf {
39+ tmp_dir ( ) . join ( path. as_ref ( ) )
40+ }
41+
3842/// `TARGET`
3943pub fn target ( ) -> String {
4044 env:: var ( "TARGET" ) . unwrap ( )
@@ -58,7 +62,7 @@ pub fn is_darwin() -> bool {
5862/// Construct a path to a static library under `$TMPDIR` given the library name. This will return a
5963/// path with `$TMPDIR` joined with platform-and-compiler-specific library name.
6064pub fn static_lib ( name : & str ) -> PathBuf {
61- tmp_dir ( ) . join ( static_lib_name ( name) )
65+ tmp_path ( static_lib_name ( name) )
6266}
6367
6468pub fn python_command ( ) -> Command {
@@ -103,7 +107,7 @@ pub fn static_lib_name(name: &str) -> String {
103107/// Construct a path to a dynamic library under `$TMPDIR` given the library name. This will return a
104108/// path with `$TMPDIR` joined with platform-and-compiler-specific library name.
105109pub fn dynamic_lib ( name : & str ) -> PathBuf {
106- tmp_dir ( ) . join ( dynamic_lib_name ( name) )
110+ tmp_path ( dynamic_lib_name ( name) )
107111}
108112
109113/// Construct the dynamic library name based on the platform.
@@ -135,7 +139,7 @@ pub fn dynamic_lib_name(name: &str) -> String {
135139/// Construct a path to a rust library (rlib) under `$TMPDIR` given the library name. This will return a
136140/// path with `$TMPDIR` joined with the library name.
137141pub fn rust_lib ( name : & str ) -> PathBuf {
138- tmp_dir ( ) . join ( rust_lib_name ( name) )
142+ tmp_path ( rust_lib_name ( name) )
139143}
140144
141145/// Generate the name a rust library (rlib) would have. If you want the complete path, use
0 commit comments