Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MSVC compiler checks #560

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -255,18 +255,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 @@ -295,6 +299,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
Loading