@@ -5,30 +5,7 @@ use std::path::{Path, PathBuf};
55use std:: process:: Command ;
66
77use super :: rustc_info:: { get_file_name, get_rustc_path, get_rustc_version} ;
8- use super :: utils:: { cargo_command, copy_dir_recursively, spawn_and_wait} ;
9-
10- pub ( crate ) const ABI_CAFE : GitRepo =
11- GitRepo :: github ( "Gankra" , "abi-cafe" , "4c6dc8c9c687e2b3a760ff2176ce236872b37212" , "abi-cafe" ) ;
12-
13- pub ( crate ) const RAND : GitRepo =
14- GitRepo :: github ( "rust-random" , "rand" , "0f933f9c7176e53b2a3c7952ded484e1783f0bf1" , "rand" ) ;
15-
16- pub ( crate ) const REGEX : GitRepo =
17- GitRepo :: github ( "rust-lang" , "regex" , "341f207c1071f7290e3f228c710817c280c8dca1" , "regex" ) ;
18-
19- pub ( crate ) const PORTABLE_SIMD : GitRepo = GitRepo :: github (
20- "rust-lang" ,
21- "portable-simd" ,
22- "d5cd4a8112d958bd3a252327e0d069a6363249bd" ,
23- "portable-simd" ,
24- ) ;
25-
26- pub ( crate ) const SIMPLE_RAYTRACER : GitRepo = GitRepo :: github (
27- "ebobby" ,
28- "simple-raytracer" ,
29- "804a7a21b9e673a482797aa289a18ed480e4d813" ,
30- "<none>" ,
31- ) ;
8+ use super :: utils:: { copy_dir_recursively, spawn_and_wait, Compiler } ;
329
3310pub ( crate ) fn prepare ( ) {
3411 if Path :: new ( "download" ) . exists ( ) {
@@ -42,22 +19,25 @@ pub(crate) fn prepare() {
4219 eprintln ! ( "[INSTALL] hyperfine" ) ;
4320 Command :: new ( "cargo" ) . arg ( "install" ) . arg ( "hyperfine" ) . spawn ( ) . unwrap ( ) . wait ( ) . unwrap ( ) ;
4421
45- ABI_CAFE . fetch ( ) ;
46- RAND . fetch ( ) ;
47- REGEX . fetch ( ) ;
48- PORTABLE_SIMD . fetch ( ) ;
49- SIMPLE_RAYTRACER . fetch ( ) ;
22+ super :: abi_cafe :: ABI_CAFE_REPO . fetch ( ) ;
23+ super :: tests :: RAND_REPO . fetch ( ) ;
24+ super :: tests :: REGEX_REPO . fetch ( ) ;
25+ super :: tests :: PORTABLE_SIMD_REPO . fetch ( ) ;
26+ super :: tests :: SIMPLE_RAYTRACER_REPO . fetch ( ) ;
5027
5128 eprintln ! ( "[LLVM BUILD] simple-raytracer" ) ;
52- let build_cmd = cargo_command ( "cargo" , "build" , None , & SIMPLE_RAYTRACER . source_dir ( ) ) ;
29+ let host_compiler = Compiler :: host ( ) ;
30+ let build_cmd = super :: tests:: SIMPLE_RAYTRACER . build ( & host_compiler) ;
5331 spawn_and_wait ( build_cmd) ;
5432 fs:: copy (
55- SIMPLE_RAYTRACER
56- . source_dir ( )
57- . join ( "target" )
33+ super :: tests :: SIMPLE_RAYTRACER
34+ . target_dir ( )
35+ . join ( & host_compiler . triple )
5836 . join ( "debug" )
5937 . join ( get_file_name ( "main" , "bin" ) ) ,
60- SIMPLE_RAYTRACER . source_dir ( ) . join ( get_file_name ( "raytracer_cg_llvm" , "bin" ) ) ,
38+ super :: tests:: SIMPLE_RAYTRACER_REPO
39+ . source_dir ( )
40+ . join ( get_file_name ( "raytracer_cg_llvm" , "bin" ) ) ,
6141 )
6242 . unwrap ( ) ;
6343}
@@ -100,7 +80,7 @@ enum GitRepoUrl {
10080}
10181
10282impl GitRepo {
103- const fn github (
83+ pub ( crate ) const fn github (
10484 user : & ' static str ,
10585 repo : & ' static str ,
10686 rev : & ' static str ,
0 commit comments