Add Support for IfcOpenShell on Win ARM64

This commit is contained in:
tsomanna_QCOM
2026-03-09 08:51:30 +05:30
committed by Thomas Krijnen
parent 8bd3fab608
commit b25c24a007
5 changed files with 27462 additions and 26 deletions
+17 -4
View File
@@ -9,6 +9,15 @@ import subprocess
import zipfile
from pathlib import Path
from zipfile import ZipFile
import platform
def is_arm64() -> bool:
arch = os.environ.get("TARGET_ARCH", "").lower()
if arch in ("arm64", "aarch64"):
return True
if arch in ("x64", "amd64", "x86_64"):
return False
return platform.machine().lower() in ("arm64", "aarch64")
assert Path.cwd() == Path(__file__).parent, "Run this script from the 'win' directory."
@@ -23,7 +32,7 @@ else:
OUTPUT_DIR = Path.home() / "output"
OUTPUT_DIR.mkdir(exist_ok=True)
print("Output directory:", OUTPUT_DIR)
ZIP_TEMPLATE = f"{{package_name}}-v{VERSION}-{SHA}-win64.zip"
ZIP_TEMPLATE = f"{{package_name}}-v{VERSION}-{SHA}-{'win-arm64' if is_arm64() else 'win64'}.zip"
def run(command: list[str]) -> None:
@@ -52,7 +61,11 @@ def build() -> None:
os.environ["PYTHON_VERSION"] = python_version
print(f"Building for Python {python_version}...")
subprocess.run(
[str(REPO_WIN / "build-deps.cmd"), "vs2022-x64", "Release"],
[
str(REPO_WIN / "build-deps.cmd"),
"vs2022-ARM64" if is_arm64() else "vs2022-x64",
"Release",
],
check=True,
text=True,
input="y\n",
@@ -61,13 +74,13 @@ def build() -> None:
run(
[
str(REPO_WIN / "run-cmake.bat"),
"vs2022-x64",
"vs2022-ARM64" if is_arm64() else "vs2022-x64",
"-DENABLE_BUILD_OPTIMIZATIONS=ON",
"-DGLTF_SUPPORT=ON",
]
)
restore_env(*OLD_ADD_COMMIT_SHA)
run([str(REPO_WIN / "install-ifcopenshell.bat"), "vs2022-x64", "Release"])
run([str(REPO_WIN / "install-ifcopenshell.bat"), "vs2022-ARM64" if is_arm64() else "vs2022-x64", "Release"])
def archive_executables() -> None: