parent
0336eae908
commit
8445ae54b3
@ -1,6 +1,11 @@
|
|||||||
#[cfg(target_vendor = "apple")]
|
use std::{
|
||||||
use std::path::PathBuf;
|
env,
|
||||||
use std::{env, fs::File, io::Write, path::Path, process::Command, str};
|
fs::File,
|
||||||
|
io::Write,
|
||||||
|
path::{Path, PathBuf},
|
||||||
|
process::Command,
|
||||||
|
str,
|
||||||
|
};
|
||||||
|
|
||||||
#[cfg(target_vendor = "apple")]
|
#[cfg(target_vendor = "apple")]
|
||||||
use glob::glob;
|
use glob::glob;
|
||||||
@ -125,6 +130,7 @@ fn find_llvm_version() -> Option<i32> {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn build_pass(
|
fn build_pass(
|
||||||
bindir_path: &Path,
|
bindir_path: &Path,
|
||||||
out_dir: &Path,
|
out_dir: &Path,
|
||||||
@ -132,17 +138,25 @@ fn build_pass(
|
|||||||
ldflags: &Vec<&str>,
|
ldflags: &Vec<&str>,
|
||||||
src_dir: &Path,
|
src_dir: &Path,
|
||||||
src_file: &str,
|
src_file: &str,
|
||||||
|
additional_srcfiles: Option<&Vec<&str>>,
|
||||||
optional: bool,
|
optional: bool,
|
||||||
) {
|
) {
|
||||||
let dot_offset = src_file.rfind('.').unwrap();
|
let dot_offset = src_file.rfind('.').unwrap();
|
||||||
let src_stub = &src_file[..dot_offset];
|
let src_stub = &src_file[..dot_offset];
|
||||||
|
|
||||||
|
let additionals = if let Some(x) = additional_srcfiles {
|
||||||
|
x.iter().map(|f| src_dir.join(f)).collect::<Vec<PathBuf>>()
|
||||||
|
} else {
|
||||||
|
Vec::new()
|
||||||
|
};
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed=src/{src_file}");
|
println!("cargo:rerun-if-changed=src/{src_file}");
|
||||||
let r = if cfg!(unix) {
|
let r = if cfg!(unix) {
|
||||||
let r = Command::new(bindir_path.join("clang++"))
|
let r = Command::new(bindir_path.join("clang++"))
|
||||||
.arg("-v")
|
.arg("-v")
|
||||||
.args(cxxflags)
|
.args(cxxflags)
|
||||||
.arg(src_dir.join(src_file))
|
.arg(src_dir.join(src_file))
|
||||||
|
.args(additionals)
|
||||||
.args(ldflags)
|
.args(ldflags)
|
||||||
.arg("-o")
|
.arg("-o")
|
||||||
.arg(out_dir.join(format!("{src_stub}.{}", dll_extension())))
|
.arg(out_dir.join(format!("{src_stub}.{}", dll_extension())))
|
||||||
@ -154,6 +168,7 @@ fn build_pass(
|
|||||||
.arg("-v")
|
.arg("-v")
|
||||||
.args(cxxflags)
|
.args(cxxflags)
|
||||||
.arg(src_dir.join(src_file))
|
.arg(src_dir.join(src_file))
|
||||||
|
.args(additionals)
|
||||||
.arg("/link")
|
.arg("/link")
|
||||||
.args(ldflags)
|
.args(ldflags)
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
@ -359,6 +374,7 @@ pub const LIBAFL_CC_LLVM_VERSION: Option<usize> = None;
|
|||||||
&ldflags,
|
&ldflags,
|
||||||
src_dir,
|
src_dir,
|
||||||
pass,
|
pass,
|
||||||
|
None,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -372,6 +388,7 @@ pub const LIBAFL_CC_LLVM_VERSION: Option<usize> = None;
|
|||||||
&ldflags,
|
&ldflags,
|
||||||
src_dir,
|
src_dir,
|
||||||
pass,
|
pass,
|
||||||
|
None,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user