mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-02 16:41:11 +00:00
* feat: native Windows ARM64 build support Builds on the merged DEPS_ARCH=arm64 plumbing (#13424) by adding the dependency and source fixes needed for a green native ARM64 build on the windows-11-arm runner. Validated end-to-end on Snapdragon X Elite hardware (via a downstream fork using the same fixes); see OrcaSlicer/OrcaSlicer#8271 for the full writeup. Dependencies: - OpenEXR 2.5.5: ImfSimd.h hard-codes IMF_HAVE_SSE2 for any MSVC, pulling in <emmintrin.h> (x86-only) -> C1189. Patch the header to require an x86 target and force SSE cache vars off on ARM64. - Boost.Context: use the winfib implementation on ARM64 (Windows Fiber API) to avoid the armasm64 / CMake ASM_ARMASM linker-module bug, while keeping the Boost::context target Boost.Asio needs. - OpenCV: disable WITH_IPP on ARM64 (Intel IPP/IPP-ICV is x86/x64 only; otherwise ~200 unresolved ippicv* externals at link). - OpenSSL: use VC-WIN64-ARM on ARM64. - FindGLEW: add an ARM64 arch branch. Sources: - clipper Int128.hpp: _mul128 is an x64-only intrinsic guarded by _WIN64 (true on ARM64); guard on _M_X64 and use the portable path. - imgui imgui_widgets.cpp: fix va_start(vaList, &text) -> va_start(vaList, text) (the &-form compiled on x64 but is invalid on ARM64). - crash reporter: StackWalker.cpp gains an _M_ARM64 branch; BaseException.cpp uses Cpsr instead of the x86-only EFlags on ARM64. CI: - New build_windows_arm64.yml on windows-11-arm: pins CMake 3.31.x, stages ARM64 GMP/MPFR from MSYS2 clangarm64 (with llvm-dlltool import libs), caches deps with a fixed-depth hashFiles key, builds and uploads the binary. OCCT/STEP, SVG-to-3D and text emboss all build and work on ARM64 (no stubs needed). Full feature parity with x64. * fix(ci): use forward-slash DESTDIR to avoid CMake '\a' escape error deps configure failed at GMP/GMP.cmake: "Invalid character escape '\a'" because DESTDIR carried Windows backslashes (C:\a\...) and is re-parsed when re-set with the /usr/local suffix. Pass DESTDIR (and the slicer's DEPS prefix) with forward slashes via %CD:\=/%. * fix(ci): don't export DESTDIR env var (CMake staged-install doubles paths) Setting a DESTDIR *environment* variable made CMake treat it as the staged install prefix and prepend it to every dependency's install path, so e.g. FreeType installed to <DESTDIR>/a/.../OrcaSlicer_dep/usr/local and OCCT then couldn't find its headers. Compute the forward-slash path into a differently-named var (ORCA_DESTDIR) and pass it only via -DDESTDIR. * ci(windows-arm64): fold ARM64 build into the standard Windows matrix Replace the standalone build_windows_arm64.yml with a matrix entry on the existing build_windows job, so x64 and ARM64 share one reusable workflow chain (build_all -> build_check_cache -> build_deps -> build_orca), per review feedback on #14059. - build_all.yml: build_windows now matrices over {x64: windows-latest, arm64: windows-11-arm} and threads `arch` through. Self-hosted runner stays x64-only. - build_check_cache.yml: cache key and dep-prefix path are now architecture-specific on Windows (deps/build-arm64/OrcaSlicer_dep). - build_release_vs.bat: accept an `arm64` argument (mirrors build_release_vs2022.bat) -> uses `-A ARM64` and the build-arm64 tree. The top-level CMake auto-derives CMAKE_PREFIX_PATH from the build dir, so no explicit prefix is needed. - build_deps.yml / build_orca.yml: gate the ARM64-only prep behind `inputs.arch == 'arm64'` -- pin CMake 3.31.x, and stage MSYS2 clangarm64 GMP/MPFR import libs. NSIS installer/PDB/profile_validator remain x64-only; ARM64 ships the portable zip. Artifact names get an arch suffix to avoid collisions between the two Windows jobs. https://claude.ai/code/session_0164c7ZhCLsYBmCiVN9pWDjK * ci(temp): generate GMP/MPFR win-arm64 blobs to commit to repo * feat(deps): add prebuilt GMP/MPFR win-arm64 blobs The repo ships prebuilt GMP/MPFR import libs + DLLs for win-x64 and win-x86; the Windows ARM64 build path copies from win-${DEPS_ARCH} (CMakeLists.txt) but the win-arm64 blobs were missing, so the slicer configure failed at "file COPY cannot find .../win-arm64/libgmp-10.dll". Add win-arm64 libgmp-10.{dll,lib} and libmpfr-4.{dll,lib}, generated from the MSYS2 clangarm64 gmp/mpfr packages with MSVC-compatible import libs via llvm-dlltool. Headers are shared across arches and unchanged. * simplify OpenEXR.cmake * set default arch * support msix * ship installer * try to fix webview2runtime issue --------- Co-authored-by: Adam Behrman <adam.behrman@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Adam Behrman <abehrman@users.noreply.github.com>
88 lines
2.7 KiB
CMake
88 lines
2.7 KiB
CMake
# Intel IPP / IPP-ICV is x86/x64 only — there is no ARM64 build, so enabling it
|
|
# leaves ~200 unresolved ippicv* externals at link time on Windows ARM64.
|
|
if (MSVC AND NOT "${DEPS_ARCH}" STREQUAL "arm64")
|
|
set(_use_IPP "-DWITH_IPP=ON")
|
|
if (DEP_DEBUG)
|
|
set(_options "FORWARD_CONFIG")
|
|
endif ()
|
|
else ()
|
|
set(_use_IPP "-DWITH_IPP=OFF")
|
|
set(_options "")
|
|
endif ()
|
|
|
|
if (IN_GIT_REPO)
|
|
set(OpenCV_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV)
|
|
endif ()
|
|
|
|
orcaslicer_add_cmake_project(OpenCV
|
|
${_options}
|
|
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
|
|
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
|
|
PATCH_COMMAND git apply ${OpenCV_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
|
|
CMAKE_ARGS
|
|
-DBUILD_SHARED_LIBS=0
|
|
-DBUILD_PERE_TESTS=OFF
|
|
-DBUILD_TESTS=OFF
|
|
-DBUILD_opencv_python_tests=OFF
|
|
-DBUILD_EXAMPLES=OFF
|
|
-DBUILD_JASPER=OFF
|
|
-DBUILD_JAVA=OFF
|
|
-DBUILD_JPEG=ON
|
|
-DBUILD_APPS_LIST=version
|
|
-DBUILD_opencv_apps=OFF
|
|
-DBUILD_opencv_java=OFF
|
|
-DBUILD_OPENEXR=OFF
|
|
-DBUILD_PNG=ON
|
|
-DBUILD_TBB=OFF
|
|
-DBUILD_WEBP=OFF
|
|
-DBUILD_ZLIB=OFF
|
|
-DWITH_1394=OFF
|
|
-DWITH_CUDA=OFF
|
|
-DWITH_EIGEN=OFF
|
|
${_use_IPP}
|
|
-DWITH_ITT=OFF
|
|
-DWITH_FFMPEG=OFF
|
|
-DWITH_GPHOTO2=OFF
|
|
-DWITH_GSTREAMER=OFF
|
|
-DOPENCV_GAPI_GSTREAMER=OFF
|
|
-DWITH_GTK_2_X=OFF
|
|
-DWITH_JASPER=OFF
|
|
-DWITH_LAPACK=OFF
|
|
-DWITH_MATLAB=OFF
|
|
-DWITH_MFX=OFF
|
|
-DWITH_DIRECTX=OFF
|
|
-DWITH_DIRECTML=OFF
|
|
-DWITH_OPENCL=OFF
|
|
-DWITH_OPENCL_D3D11_NV=OFF
|
|
-DWITH_OPENCLAMDBLAS=OFF
|
|
-DWITH_OPENCLAMDFFT=OFF
|
|
-DWITH_OPENEXR=OFF
|
|
-DWITH_OPENJPEG=OFF
|
|
-DWITH_QUIRC=OFF
|
|
-DWITH_VTK=OFF
|
|
-DWITH_JPEG=OFF
|
|
-DWITH_WEBP=OFF
|
|
-DWITH_TIFF=OFF
|
|
-DBUILD_TIFF=OFF
|
|
-DENABLE_PRECOMPILED_HEADERS=OFF
|
|
-DINSTALL_TESTS=OFF
|
|
-DINSTALL_C_EXAMPLES=OFF
|
|
-DINSTALL_PYTHON_EXAMPLES=OFF
|
|
-DOPENCV_GENERATE_SETUPVARS=OFF
|
|
-DOPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT=OFF
|
|
-DBUILD_opencv_python2=OFF
|
|
-DBUILD_opencv_python3=OFF
|
|
-DWITH_OPENVINO=OFF
|
|
-DWITH_INF_ENGINE=OFF
|
|
-DWITH_NGRAPH=OFF
|
|
-DBUILD_WITH_STATIC_CRT=OFF#set /MDd /MD
|
|
-DBUILD_LIST=core,imgcodecs,imgproc,world
|
|
-DBUILD_opencv_highgui=OFF
|
|
-DWITH_ADE=OFF
|
|
-DBUILD_opencv_world=ON
|
|
-DWITH_PROTOBUF=OFF
|
|
-DWITH_WIN32UI=OFF
|
|
-DHAVE_WIN32UI=FALSE
|
|
)
|
|
|