fix(ci): add missing c flags in M1 pipeline

This commit is contained in:
Federico Terzi 2021-10-03 10:13:09 +02:00
parent b7a80c956a
commit 6930687d01
2 changed files with 5 additions and 10 deletions

View File

@ -60,5 +60,8 @@ jobs:
- name: Build
run: |
cargo make build-macos-arm-binary
- name: Debug
run: |
file target/aarch64-apple-darwin/debug/espanso
# TODO: add clippy check

View File

@ -200,6 +200,7 @@ fn build_native() {
"-isysroot {} -isystem {} -DSTDC_HEADERS=1 -DHAVE_FCNTL_H -arch arm64 -arch x86_64",
xcode_sdk_path, xcode_sdk_path
);
let configure_c_flags = "-arch arm64 -arch x86_64";
Command::new(out_wx_dir.join("configure"))
.current_dir(build_dir.to_string_lossy().to_string())
@ -211,6 +212,7 @@ fn build_native() {
"--with-libpng=builtin",
])
.env("CXXFLAGS", &configure_cxx_flags)
.env("CFLAGS", configure_c_flags)
.spawn()
.expect("failed to execute configure")
} else {
@ -303,16 +305,6 @@ fn convert_fat_libraries_to_arm(lib_dir: &Path) {
{
let path = entry.expect("unable to unwrap glob entry");
if path
.file_name()
.unwrap_or_default()
.to_string_lossy()
.contains("-arm.a")
{
println!("skipping {} as it's already arm", path.to_string_lossy());
continue;
}
// Make sure it's a fat library
let lipo_output = std::process::Command::new("lipo")
.args(&["-detailed_info", &path.to_string_lossy().to_string()])