@@ -256,12 +256,22 @@ impl Project {
256
256
self . root . clone ( )
257
257
}
258
258
259
- /// Project's target dir, ex: `/path/to/cargo/target/cit/t0/foo/target`
259
+ /// Project's target dir, ex: `/path/to/cargo/target/cit/t0/foo/target/target-triple `
260
260
pub fn build_dir ( & self ) -> PathBuf {
261
- self . root ( ) . join ( "target" )
261
+ self . root ( ) . join ( "target" ) . join ( rustc_host ( ) )
262
262
}
263
263
264
- /// Project's debug dir, ex: `/path/to/cargo/target/cit/t0/foo/target/debug`
264
+ /// Project's target dir, ex: `/path/to/cargo/target/cit/t0/foo/target/host/host-triple`
265
+ pub fn host_dir ( & self ) -> PathBuf {
266
+ self . root ( ) . join ( "target/host" ) . join ( rustc_host ( ) )
267
+ }
268
+
269
+ /// Project's debug dir, ex: `/path/to/cargo/target/cit/t0/foo/target/host/host-triple/debug`
270
+ pub fn host_debug_dir ( & self ) -> PathBuf {
271
+ self . host_dir ( ) . join ( "debug" )
272
+ }
273
+
274
+ /// Project's debug dir, ex: `/path/to/cargo/target/cit/t0/foo/target/target-triple/debug`
265
275
pub fn target_debug_dir ( & self ) -> PathBuf {
266
276
self . build_dir ( ) . join ( "debug" )
267
277
}
@@ -280,16 +290,25 @@ impl Project {
280
290
. join ( paths:: get_lib_filename ( name, kind) )
281
291
}
282
292
293
+ /// Path to an example built as a library.
294
+ /// `kind` should be one of: "lib", "rlib", "staticlib", "dylib", "proc-macro"
295
+ /// ex: `/path/to/cargo/target/cit/t0/foo/target/host/host-triple/debug/examples/libex.rlib`
296
+ pub fn host_example_lib ( & self , name : & str , kind : & str ) -> PathBuf {
297
+ self . host_debug_dir ( )
298
+ . join ( "examples" )
299
+ . join ( paths:: get_lib_filename ( name, kind) )
300
+ }
301
+
283
302
/// Path to a debug binary.
284
- /// ex: `/path/to/cargo/target/cit/t0/foo/target/debug/foo`
303
+ /// ex: `/path/to/cargo/target/target-triple/ cit/t0/foo/target/target-triple /debug/foo`
285
304
pub fn bin ( & self , b : & str ) -> PathBuf {
286
305
self . build_dir ( )
287
306
. join ( "debug" )
288
307
. join ( & format ! ( "{}{}" , b, env:: consts:: EXE_SUFFIX ) )
289
308
}
290
309
291
310
/// Path to a release binary.
292
- /// ex: `/path/to/cargo/target/cit/t0/foo/target/release/foo`
311
+ /// ex: `/path/to/cargo/target/target-triple/ cit/t0/foo/target/target-triple /release/foo`
293
312
pub fn release_bin ( & self , b : & str ) -> PathBuf {
294
313
self . build_dir ( )
295
314
. join ( "release" )
@@ -299,11 +318,11 @@ impl Project {
299
318
/// Path to a debug binary for a specific target triple.
300
319
/// ex: `/path/to/cargo/target/cit/t0/foo/target/i686-apple-darwin/debug/foo`
301
320
pub fn target_bin ( & self , target : & str , b : & str ) -> PathBuf {
302
- self . build_dir ( ) . join ( target ) . join ( "debug" ) . join ( & format ! (
303
- "{}{}" ,
304
- b ,
305
- env :: consts :: EXE_SUFFIX
306
- ) )
321
+ self . root ( )
322
+ . join ( "target" )
323
+ . join ( target )
324
+ . join ( "debug" )
325
+ . join ( & format ! ( "{}{}" , b , env :: consts :: EXE_SUFFIX ) )
307
326
}
308
327
309
328
/// Returns an iterator of paths matching the glob pattern, which is
0 commit comments