Ensure ankihelper is rebuilt on arch change

https://forums.ankiweb.net/t/24-04-breaks-dark-mode-on-mac/43048
This commit is contained in:
Damien Elmes 2024-04-03 15:07:36 +07:00
parent 022a95db25
commit bdc9be2bbb
2 changed files with 3 additions and 1 deletions

View File

@ -347,6 +347,7 @@ fn build_macos_helper(build: &mut Build) -> Result<()> {
inputs: hashmap! {
"script" => inputs!["qt/mac/helper_build.py"],
"in" => inputs![glob!["qt/mac/*.swift"]],
"" => inputs!["out/env"],
},
outputs: hashmap! {
"out" => vec!["qt/_aqt/data/lib/libankihelper.dylib"],

View File

@ -1,6 +1,7 @@
# Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import os
import platform
import subprocess
import sys
@ -10,7 +11,7 @@ out_dylib, *src_files = sys.argv[1:]
out_dir = Path(out_dylib).parent.resolve()
src_dir = Path(src_files[0]).parent.resolve()
if platform.machine() == "arm64":
if platform.machine() == "arm64" and not os.environ.get("MAC_X86"):
target = "arm64-apple-macos11"
else:
target = "x86_64-apple-macos10.14"