Skip to content

Commit

Permalink
Fix MSVC compiler checks
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Oct 7, 2024
1 parent 671415f commit ef60f57
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,22 @@ impl CcBuilder {
let mut ret_val = false;
let output_dir = self.out_dir.join(format!("out-{basename}"));
let mut cc_build = self.create_builder();
let result = cc_build
cc_build
.file(
self.manifest_dir
.join("aws-lc")
.join("tests")
.join("compiler_features_tests")
.join(format!("{basename}.c")),
)
.flag("-Wno-unused-parameter")
.warnings_into_errors(true)
.out_dir(&output_dir)
.try_compile_intermediates();
.out_dir(&output_dir);

let compiler = cc_build.get_compiler();
if compiler.is_like_gnu() || compiler.is_like_clang() {
cc_build.flag("-Wno-unused-parameter");
}
let result = cc_build.try_compile_intermediates();

if result.is_ok() {
if !flag.is_empty() {
Expand Down Expand Up @@ -293,6 +297,10 @@ impl CcBuilder {
let exec_path = out_dir().join(basename);
let memcmp_build = cc::Build::default();
let memcmp_compiler = memcmp_build.get_compiler();
if !memcmp_compiler.is_like_clang() && !memcmp_compiler.is_like_gnu() {
// The logic below assumes a Clang or GCC compiler is in use
return;
}
let mut memcmp_compile_args = Vec::from(memcmp_compiler.args());
memcmp_compile_args.push(
self.manifest_dir
Expand Down

0 comments on commit ef60f57

Please sign in to comment.