Skip to content

Commit 0207364

Browse files
authored
Set CFLAGS before init'ing cc::Build (#966)
1 parent 93f8b32 commit 0207364

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

aws-lc-sys/builder/cc_builder.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,16 @@ impl CcBuilder {
345345
}
346346

347347
pub fn prepare_builder(&self) -> cc::Build {
348+
let cflags = get_crate_cflags();
349+
if !cflags.is_empty() {
350+
set_env_for_target("CFLAGS", cflags);
351+
}
352+
348353
let mut cc_build = self.create_builder();
349354
let (_, build_options) = self.collect_universal_build_options(&cc_build);
350355
for option in build_options {
351356
option.apply_cc(&mut cc_build);
352357
}
353-
let cflags = get_crate_cflags();
354-
if !cflags.is_empty() {
355-
set_env_for_target("CFLAGS", cflags);
356-
}
357358

358359
// Add --noexecstack flag for assembly files to prevent executable stacks
359360
// This matches the behavior of AWS-LC's CMake build which uses -Wa,--noexecstack

0 commit comments

Comments
 (0)