Skip to content

Commit

Permalink
Infer if current compiler is clang
Browse files Browse the repository at this point in the history
  • Loading branch information
xxuejie committed Aug 31, 2023
1 parent 3556380 commit a6c1445
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,22 @@ fn main() {
None => "clang-16".into(),
};

build.compiler(clang);
}

let compiler = build.get_compiler();
if compiler.is_like_clang() {
build
.compiler(clang)
.no_default_flags(true)
.flag("--target=riscv64")
.flag("-march=rv64imc_zba_zbb_zbc_zbs");
} else {
} else if compiler.is_like_gnu() {
build
.flag("-nostartfiles")
.flag("-Wno-dangling-pointer")
.flag("-Wno-nonnull-compare");
}

build.compile("dl-c-impl");
}

Expand Down

0 comments on commit a6c1445

Please sign in to comment.