Skip to content

Commit 6fee90d

Browse files
adding gcc-specific flags
1 parent 2410fae commit 6fee90d

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

crates/intrinsic-test/src/arm/compile.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ pub fn build_cpp_compilation(config: &ProcessedCli) -> Option<CppCompilation> {
1818
command = command.add_arch_flags(["faminmax", "lut", "sha3"]);
1919
}
2020

21-
if !cpp_compiler.contains("clang") {
22-
command = command.add_extra_flag("-flax-vector-conversions");
23-
}
21+
command = if !cpp_compiler.contains("clang") {
22+
command.add_extra_flag("-flax-vector-conversions")
23+
} else {
24+
command.add_extra_flag(format!("--target={}", config.target).as_str())
25+
};
2426

2527
let mut cpp_compiler = command.into_cpp_compilation();
2628

crates/intrinsic-test/src/common/compile_c.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ impl CompilationCommandBuilder {
8484

8585
cpp_compiler.args(self.extra_flags);
8686

87-
if let Some(target) = &self.target {
88-
cpp_compiler.arg(format!("--target={target}"));
89-
}
90-
9187
CppCompilation(cpp_compiler)
9288
}
9389
}

crates/intrinsic-test/src/x86/compile.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ pub fn build_cpp_compilation(config: &ProcessedCli) -> Option<CppCompilation> {
3333
"-mavx512vbmi2",
3434
"-mavx512vnni",
3535
"-mavx512vpopcntdq",
36-
"-ferror-limit=1000",
3736
"-std=c++23",
3837
]);
3938

40-
if !cpp_compiler.contains("clang") {
41-
command = command.add_extra_flag("-flax-vector-conversions");
42-
}
39+
command = if !cpp_compiler.contains("clang") {
40+
command.add_extra_flags(vec!["-fmax-errors=1000", "-flax-vector-conversions"])
41+
} else {
42+
command.add_extra_flags(vec![
43+
"-ferror-limit=1000",
44+
format!("--target={}", config.target).as_str(),
45+
])
46+
};
4347

4448
let cpp_compiler = command.into_cpp_compilation();
4549

0 commit comments

Comments
 (0)