Skip to content

Commit b0709d3

Browse files
committed
Fix MacOS build failed
1 parent 3a7e236 commit b0709d3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

phper-sys/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ fn main() {
2121
let includes = execute_command(&[php_config.as_str(), "--includes"]);
2222
let includes = includes.split(' ').collect::<Vec<_>>();
2323

24+
let mut extas_args = Vec::new();
25+
if cfg!(all(
26+
target_arch = "aarch64",
27+
any(target_os = "macos", target_os = "ios")
28+
)) {
29+
extas_args.push("-mno-neon");
30+
}
31+
2432
// Generate libphpwrapper.a.
2533

2634
let mut builder = cc::Build::new();
@@ -49,6 +57,7 @@ fn main() {
4957
// Block the `zend_random_bytes_insecure` because it fails checks.
5058
.blocklist_item("zend_random_bytes_insecure")
5159
.clang_args(&includes)
60+
.clang_args(&extas_args)
5261
.derive_default(true);
5362

5463
// iterate over the php include directories, and update the builder

0 commit comments

Comments
 (0)