@@ -256,12 +256,22 @@ impl Project {
256256 self . root . clone ( )
257257 }
258258
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 `
260260 pub fn build_dir ( & self ) -> PathBuf {
261- self . root ( ) . join ( "target" )
261+ self . root ( ) . join ( "target" ) . join ( rustc_host ( ) )
262262 }
263263
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`
265275 pub fn target_debug_dir ( & self ) -> PathBuf {
266276 self . build_dir ( ) . join ( "debug" )
267277 }
@@ -280,16 +290,25 @@ impl Project {
280290 . join ( paths:: get_lib_filename ( name, kind) )
281291 }
282292
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+
283302 /// 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`
285304 pub fn bin ( & self , b : & str ) -> PathBuf {
286305 self . build_dir ( )
287306 . join ( "debug" )
288307 . join ( & format ! ( "{}{}" , b, env:: consts:: EXE_SUFFIX ) )
289308 }
290309
291310 /// 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`
293312 pub fn release_bin ( & self , b : & str ) -> PathBuf {
294313 self . build_dir ( )
295314 . join ( "release" )
@@ -299,11 +318,11 @@ impl Project {
299318 /// Path to a debug binary for a specific target triple.
300319 /// ex: `/path/to/cargo/target/cit/t0/foo/target/i686-apple-darwin/debug/foo`
301320 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 ) )
307326 }
308327
309328 /// Returns an iterator of paths matching the glob pattern, which is
0 commit comments