Add --download-dir option to specify download dir separate from --out-dir

This commit is contained in:
bjorn3 2023-02-13 10:38:25 +00:00
parent 45781e107c
commit ce3f300e40
2 changed files with 18 additions and 7 deletions

View File

@ -81,6 +81,7 @@ pub(crate) fn main() {
};
let mut out_dir = PathBuf::from(".");
let mut download_dir = None;
let mut channel = "release";
let mut sysroot_kind = SysrootKind::Clif;
let mut use_unstable_features = true;
@ -91,7 +92,12 @@ pub(crate) fn main() {
"--out-dir" => {
out_dir = PathBuf::from(args.next().unwrap_or_else(|| {
arg_error!("--out-dir requires argument");
}))
}));
}
"--download-dir" => {
download_dir = Some(PathBuf::from(args.next().unwrap_or_else(|| {
arg_error!("--download-dir requires argument");
})));
}
"--debug" => channel = "debug",
"--sysroot" => {
@ -152,7 +158,9 @@ pub(crate) fn main() {
out_dir = current_dir.join(out_dir);
let dirs = path::Dirs {
source_dir: current_dir.clone(),
download_dir: out_dir.join("download"),
download_dir: download_dir
.map(|dir| current_dir.join(dir))
.unwrap_or_else(|| out_dir.join("download")),
build_dir: out_dir.join("build"),
dist_dir: out_dir.join("dist"),
frozen,

View File

@ -1,11 +1,11 @@
The build system of cg_clif.
USAGE:
./y.rs prepare [--out-dir DIR]
./y.rs build [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features] [--frozen]
./y.rs test [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features] [--frozen]
./y.rs abi-cafe [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features] [--frozen]
./y.rs bench [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--no-unstable-features] [--frozen]
./y.rs prepare [--out-dir DIR] [--download-dir DIR]
./y.rs build [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--download-dir DIR] [--no-unstable-features] [--frozen]
./y.rs test [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--download-dir DIR] [--no-unstable-features] [--frozen]
./y.rs abi-cafe [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--download-dir DIR] [--no-unstable-features] [--frozen]
./y.rs bench [--debug] [--sysroot none|clif|llvm] [--out-dir DIR] [--download-dir DIR] [--no-unstable-features] [--frozen]
OPTIONS:
--debug
@ -22,6 +22,9 @@ OPTIONS:
Specify the directory in which the download, build and dist directories are stored.
By default this is the working directory.
--download-dir DIR
Specify the directory in which the download directory is stored. Overrides --out-dir.
--no-unstable-features
Some features are not yet ready for production usage. This option will disable these
features. This includes the JIT mode and inline assembly support.