Skip to content

Commit 2f172b4

Browse files
committed
Adding target_rustcflags to TargetCfg
1 parent 09ae784 commit 2f172b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tools/compiletest/src/common.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ impl Config {
385385
}
386386

387387
fn target_cfg(&self) -> &TargetCfg {
388-
self.target_cfg.borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target))
388+
self.target_cfg
389+
.borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target, &self.target_rustcflags))
389390
}
390391

391392
pub fn matches_arch(&self, arch: &str) -> bool {
@@ -456,11 +457,12 @@ pub enum Endian {
456457
}
457458

458459
impl TargetCfg {
459-
fn new(rustc_path: &Path, target: &str) -> TargetCfg {
460+
fn new(rustc_path: &Path, target: &str, target_rustcflags: &Option<String>) -> TargetCfg {
460461
let output = match Command::new(rustc_path)
461462
.arg("--print=cfg")
462463
.arg("--target")
463464
.arg(target)
465+
.args(target_rustcflags.into_iter().map(|s| s.split_whitespace()).flatten())
464466
.output()
465467
{
466468
Ok(output) => output,

0 commit comments

Comments
 (0)