Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
- os: ubuntu-24.04
- os: ubuntu-26.04
- os: windows-latest
- os: windows-11-arm
arch: arm64
- os: windows-11-arm
arch: arm64ec
- os: macos-15-intel
arch: x86_64
- os: macos-15
Expand Down
40 changes: 36 additions & 4 deletions .github/workflows/build_bambu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fail-on-cache-miss: true

- name: Get the version and date on Ubuntu and macOS
if: inputs.os != 'windows-latest'
if: ${{ !startsWith(inputs.os, 'windows') }}
run: |
ver_pure=$(grep 'set(SLIC3R_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
Expand All @@ -51,7 +51,7 @@ jobs:
shell: bash

- name: Get the version and date on Windows
if: inputs.os == 'windows-latest'
if: startsWith(inputs.os, 'windows')
run: |
$date = Get-Date -Format 'yyyyMMdd'
$ref = "${{ github.ref }}"
Expand Down Expand Up @@ -114,11 +114,11 @@ jobs:

# Windows
- name: setup MSVC
if: inputs.os == 'windows-latest'
if: startsWith(inputs.os, 'windows')
uses: microsoft/setup-msbuild@v2

- name: Install nsis and pkgconfig
if: inputs.os == 'windows-latest'
if: startsWith(inputs.os, 'windows')
run: |
dir "C:/Program Files (x86)/Windows Kits/10/Include"
choco install nsis
Expand All @@ -133,6 +133,25 @@ jobs:
cmake .. -G "Visual Studio 18 2026" -A X64 -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0 -DCMAKE_PREFIX_PATH="${{ github.workspace }}\deps\build\BambuStudio_dep\usr\local" -DCMAKE_INSTALL_PREFIX="../install-dir" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0"
cmake --build . --target install --config Release -- -m

# Windows on ARM64/ARM64EC: VS 2022 generator (the arm runner has no VS
# 2026), and the newest installed 10.* SDK is resolved at runtime rather
# than pinned, since the arm image may not ship the exact SDK the x64 job
# hard-codes. arm64ec produces the variant that can load the x64-only
# Bambu network plugin in-process at native speed.
- name: Build slicer Win ARM64/ARM64EC
if: inputs.os == 'windows-11-arm'
working-directory: ${{ github.workspace }}
shell: pwsh
run: |
$sdkRoot = "C:/Program Files (x86)/Windows Kits/10/Include"
$sdk = (Get-ChildItem $sdkRoot -Directory | Where-Object { $_.Name -match '^10\.' } | Sort-Object Name -Descending | Select-Object -First 1).FullName
Write-Output "Using Windows SDK: $sdk"
$platform = "${{ inputs.arch }}" -eq "arm64ec" ? "ARM64EC" : "ARM64"
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A $platform -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0 -DCMAKE_PREFIX_PATH="${{ github.workspace }}\deps\build\BambuStudio_dep\usr\local" -DCMAKE_INSTALL_PREFIX="../install-dir" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="$sdk"
cmake --build . --target install --config Release -- -m

# - name: Create installer Win
# if: inputs.os == 'windows-latest'
# working-directory: ${{ github.workspace }}/build
Expand All @@ -145,6 +164,12 @@ jobs:
shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip BambuStudio_Windows_${{ env.ver }}_portable.zip ${{ github.workspace }}/install-dir'

- name: Pack app ARM64
if: inputs.os == 'windows-11-arm'
working-directory: ${{ github.workspace }}
shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip BambuStudio_Windows_${{ env.ver }}_${{ inputs.arch }}_portable.zip ${{ github.workspace }}/install-dir'

# - name: Pack PDB
# if: inputs.os == 'windows-latest'
# working-directory: ${{ github.workspace }}/build/src/Release
Expand All @@ -158,6 +183,13 @@ jobs:
name: BambuStudio_Windows_${{ env.ver }}_portable
path: ${{ github.workspace }}/BambuStudio_Windows_${{ env.ver }}_portable.zip

- name: Upload artifacts Win ARM64 zip
if: inputs.os == 'windows-11-arm'
uses: actions/upload-artifact@v6
with:
name: BambuStudio_Windows_${{ env.ver }}_${{ inputs.arch }}_portable
path: ${{ github.workspace }}/BambuStudio_Windows_${{ env.ver }}_${{ inputs.arch }}_portable.zip


# Ubuntu
- name: Install dependencies from BuildLinux.sh
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build_check_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ jobs:
- name: set outputs
id: set_outputs
env:
dep-folder-name: ${{ inputs.os == 'windows-latest' && '/BambuStudio_dep' || ((inputs.os == 'macos-15-intel' || inputs.os == 'macos-15' || inputs.os == 'macos-26') && '') || (inputs.os != 'macos-15-intel' && inputs.os != 'macos-15' && inputs.os != 'macos-26') && '/destdir' || '' }}
output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
dep-folder-name: ${{ startsWith(inputs.os, 'windows') && '/BambuStudio_dep' || ((inputs.os == 'macos-15-intel' || inputs.os == 'macos-15' || inputs.os == 'macos-26') && '') || (inputs.os != 'macos-15-intel' && inputs.os != 'macos-15' && inputs.os != 'macos-26') && '/destdir' || '' }}
output-cmd: ${{ startsWith(inputs.os, 'windows') && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
# Windows runs two variants (arm64/arm64ec) on the same runner label,
# so the arch must be part of the key or their caches collide.
arch-suffix: ${{ (startsWith(inputs.os, 'windows') && inputs.arch != '') && format('-{0}', inputs.arch) || '' }}
run: |
echo cache-key=${{ inputs.os }}-cache-bambustudio_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
echo cache-key=${{ inputs.os }}${{ env.arch-suffix }}-cache-bambustudio_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
echo cache-path=${{ github.workspace }}/deps/build${{ env.dep-folder-name }} >> ${{ env.output-cmd }}

- name: load cache
Expand Down
39 changes: 36 additions & 3 deletions .github/workflows/build_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ jobs:
key: ${{ inputs.cache-key }}

- name: setup dev on Windows
if: inputs.os == 'windows-latest'
if: startsWith(inputs.os, 'windows')
uses: microsoft/setup-msbuild@v2

- name: Get the date on Ubuntu and macOS
if: inputs.os != 'windows-latest'
if: ${{ !startsWith(inputs.os, 'windows') }}
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
shell: bash

- name: Get the date on Windows
if: inputs.os == 'windows-latest'
if: startsWith(inputs.os, 'windows')
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
shell: pwsh

Expand All @@ -74,6 +74,32 @@ jobs:
working-directory: ${{ github.workspace }}
run: Compress-Archive -Path "${{ github.workspace }}\deps\build\BambuStudio_dep\*" -DestinationPath "${{ github.workspace }}\deps\build\BambuStudio_dep_win64_${{ env.date }}_vs2022.zip"
shell: pwsh

# Windows on ARM64/ARM64EC. The windows-11-arm runner ships Visual
# Studio 2022 (v17), not 2026, so the generator differs from the x64 job
# above. All per-dep arch handling lives in deps/*.cmake and is selected
# automatically from the -A platform (arm64ec = native ARM64 code with
# the x64-compatible ABI, which is what lets the app load the x64-only
# Bambu network plugin in-process).
- name: Build on Windows ARM64/ARM64EC
if: inputs.os == 'windows-11-arm'
working-directory: ${{ github.workspace }}
run: |
choco install strawberryperl
choco install pkgconfiglite
mkdir ${{ github.workspace }}\deps\build
mkdir ${{ github.workspace }}\deps\build\BambuStudio_dep
cd "${{ github.workspace }}\deps\build"
$platform = "${{ inputs.arch }}" -eq "arm64ec" ? "ARM64EC" : "ARM64"
cmake ../ -G "Visual Studio 17 2022" -A $platform -DDESTDIR="./BambuStudio_dep" -DCMAKE_BUILD_TYPE=Release -DDEP_DEBUG=OFF
msbuild /m ALL_BUILD.vcxproj
shell: pwsh

- name: pack deps on Windows ARM64/ARM64EC
if: inputs.os == 'windows-11-arm'
working-directory: ${{ github.workspace }}
run: Compress-Archive -Path "${{ github.workspace }}\deps\build\BambuStudio_dep\*" -DestinationPath "${{ github.workspace }}\deps\build\BambuStudio_dep_win-${{ inputs.arch }}_${{ env.date }}_vs2022.zip"
shell: pwsh

- name: Fix python install error on mac
if: inputs.os == 'macos-15-intel'
Expand Down Expand Up @@ -167,6 +193,13 @@ jobs:
name: BambuStudio_dep_win64_${{ env.date }}
path: ${{ github.workspace }}/deps/build/BambuStudio_dep*.zip

- name: Upload Windows ARM64/ARM64EC artifacts
if: inputs.os == 'windows-11-arm'
uses: actions/upload-artifact@v6
with:
name: BambuStudio_dep_win-${{ inputs.arch }}_${{ env.date }}
path: ${{ github.workspace }}/deps/build/BambuStudio_dep*.zip

- name: Upload Ubuntu artifacts
if: ${{ ! env.ACT && (inputs.os == 'ubuntu-22.04' || inputs.os == 'ubuntu-24.04' || inputs.os == 'ubuntu-26.04') }}
uses: actions/upload-artifact@v6
Expand Down
37 changes: 35 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ elseif (MSVC)
message(STATUS " is cross compile set to true.............")
set(IS_CROSS_COMPILE TRUE)
endif ()
if (CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64EC")
# On ARM64EC the x86 SIMD headers (immintrin.h etc.) refuse direct
# inclusion - they must come via <intrin.h> so the softintrin
# emulation layer is set up first. Several bundled libraries
# (eigen, imgui, clipper2, tinybvh, libigl, minih264) include them
# directly, so force-include intrin.h globally instead of patching
# each one.
add_compile_options(/FIintrin.h)
# Software implementations of x86 intrinsics that have no native
# ARM64EC lowering (e.g. _mm_cvtsd_si64). MSBuild does not add this
# automatically for CMake-generated projects.
add_link_options(softintrin.lib)
endif ()
endif ()

# Proposal for C++ unit tests and sandboxes
Expand Down Expand Up @@ -132,7 +145,19 @@ if (MSVC)
# /bigobj (Increase Number of Sections in .Obj file)
# error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm90' or greater
# Generate symbols at every build target, even for the release.
add_compile_options(-bigobj -Zm520 /Zi)
if (CMAKE_GENERATOR MATCHES "Ninja")
# /Z7 embeds debug info in the objects instead of writing per-target
# .pdb files during compilation: /Zi's shared-PDB writes fail with
# C1041 under Ninja's parallelism (the VS generator serializes them
# via /FS+mspdbsrv) and defeat compiler-launcher caches like sccache.
# Only debug-carrying configs get it - embedding into every object of
# a Release build pushes libslic3r_gui.lib past the 4 GB .lib format
# limit (LNK1248), and plain Release omits debug info in standard
# CMake semantics anyway.
add_compile_options(-bigobj -Zm520 "$<$<OR:$<CONFIG:RelWithDebInfo>,$<CONFIG:Debug>>:/Z7>")
else ()
add_compile_options(-bigobj -Zm520 /Zi)
endif ()
# Disable STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17.
#FIXME Remove this line after eigen library adapts to the new C++17 adaptor rules.
add_compile_options(-D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING)
Expand Down Expand Up @@ -636,7 +661,15 @@ function(bambustudio_copy_dlls target config postfix output_dlls)
set(_bits 32)
endif ()

if ((CMAKE_SYSTEM_PROCESSOR MATCHES "^(ARM64|aarch64)$") OR (CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64"))
# Generator platform takes precedence over the host processor so an ARM64
# host can build x64 or ARM64EC targets (both consume the x64 runtime DLLs;
# ARM64EC processes load x64 DLLs via emulation).
set(_copydll_plat "${CMAKE_GENERATOR_PLATFORM}")
if (NOT _copydll_plat)
set(_copydll_plat "${CMAKE_SYSTEM_PROCESSOR}")
endif ()
string(TOUPPER "${_copydll_plat}" _copydll_plat)
if (_copydll_plat MATCHES "^(ARM64|AARCH64)$")
set(_gmpdll win_arm64/gmp-10.dll)
set(_mpfrdll win_arm64/mpfr-6.dll)
set(output_gmpdll gmp-10.dll)
Expand Down
6 changes: 6 additions & 0 deletions cmake/modules/FindGLEW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ endif()

if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64" OR "${CMAKE_GENERATOR}" MATCHES "Win64")
set(_arch "x64")
elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "ARM64|arm64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^(ARM64|aarch64)$")
# GLEW's binary distribution ships one 64-bit import-library layout; ARM64
# reuses the x64 lib/Release path. (Bambu builds GLEW from source into the
# dep prefix, so this only affects the GLEW_ROOT binary-dist fallback.)
# Matched case-insensitively since build_win.bat passes -A arm64 (lowercase).
set(_arch "x64")
else()
set(_arch "Win32")
endif()
Expand Down
18 changes: 17 additions & 1 deletion deps/Boost/Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ if (MSVC)
set(_context_arch_line "-DBOOST_CONTEXT_ARCHITECTURE:STRING=arm64")
set(_context_impl_line "-DBOOST_CONTEXT_IMPLEMENTATION:STRING=winfib")
message(STATUS "BOOST param: ${_context_abi_line} ${_context_arch_line} ${_context_impl_line}")
elseif (_msvc_target_arch STREQUAL "ARM64EC")
# ARM64EC uses the x64-compatible ABI; the Windows Fiber implementation
# needs no assembler, sidestepping fcontext arch detection entirely.
set(_context_impl_line "-DBOOST_CONTEXT_IMPLEMENTATION:STRING=winfib")
# Boost.JSON's ryu needs __shiftright128, which ARM64EC lacks (no
# native lowering, no softintrin fallback); cobalt is in the same
# C++20-era boat. Neither is used by BambuStudio.
set(_boost_ec_extra_excludes "|json|cobalt")
message(STATUS "BOOST param: ${_context_impl_line}")
elseif (_msvc_target_arch STREQUAL "X64")
# Pin arch AND abi: Boost.Context otherwise sniffs the HOST processor,
# so building x64 deps on an ARM64 host selects armasm/aapcs and fails
# (x86_64 + aapcs has no asm source; the x64 Windows ABI is 'ms').
set(_context_abi_line "-DBOOST_CONTEXT_ABI:STRING=ms")
set(_context_arch_line "-DBOOST_CONTEXT_ARCHITECTURE:STRING=x86_64")
message(STATUS "BOOST param: ${_context_abi_line} ${_context_arch_line}")
endif ()
endif ()

Expand All @@ -38,7 +54,7 @@ bambustudio_add_cmake_project(Boost
LIST_SEPARATOR |
PATCH_COMMAND git apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-FIX-OBS-cannot-start-streaming-on-MAC.patch
CMAKE_ARGS
-DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|wave|test
-DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|wave|test${_boost_ec_extra_excludes}
-DBOOST_LOCALE_ENABLE_ICU:BOOL=OFF # do not link to libicu, breaks compatibility between distros
-DBUILD_TESTING:BOOL=OFF
"${_context_abi_line}"
Expand Down
22 changes: 20 additions & 2 deletions deps/FFMPEG/FFMPEG.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
set(_conf_cmd ./configure)

if (MSVC)
# bambulab's ffmpeg_prebuilts are x64-only; linking them on ARM64 leaves
# every av*/sws* symbol unresolved. For Windows ARM64 use BtbN's winarm64
# shared build (pinned autobuild tag). FFmpeg 7.0/7.1 share the same
# library majors (avcodec-61, avutil-59, swscale-8), so the layout and DLL
# names match what the x64 package ships and what the code links against.
set(_ffmpeg_msvc_url "https://github.com/bambulab/ffmpeg_prebuilts/releases/download/7.0.2/7.0.2_msvc.zip")
set(_ffmpeg_msvc_hash "SHA256=DF44AE6B97CE84C720695AE7F151B4A9654915D1841C68F10D62A1189E0E7181")
# Generator platform takes precedence over the host processor so an ARM64
# host can still build x64 deps (and ARM64EC targets get the x64 package).
set(_ffmpeg_gen_platform "${CMAKE_GENERATOR_PLATFORM}")
if (NOT _ffmpeg_gen_platform)
set(_ffmpeg_gen_platform "${CMAKE_SYSTEM_PROCESSOR}")
endif ()
string(TOUPPER "${_ffmpeg_gen_platform}" _ffmpeg_gen_platform)
if (_ffmpeg_gen_platform MATCHES "^(ARM64|AARCH64)$")
set(_ffmpeg_msvc_url "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-07-17-13-22/ffmpeg-n7.1.5-2-g998de74adf-winarm64-gpl-shared-7.1.zip")
set(_ffmpeg_msvc_hash "SHA256=37e39b6f9115ec01a0ac6d7728e629e6be988d42495c850da4514930ad857f97")
endif ()
set(_dstdir ${DESTDIR}/usr/local)
set(_source_dir "${CMAKE_BINARY_DIR}/dep_FFMPEG-prefix/src/dep_FFMPEG")
ExternalProject_Add(dep_FFMPEG
URL https://github.com/bambulab/ffmpeg_prebuilts/releases/download/7.0.2/7.0.2_msvc.zip
URL_HASH SHA256=DF44AE6B97CE84C720695AE7F151B4A9654915D1841C68F10D62A1189E0E7181
URL ${_ffmpeg_msvc_url}
URL_HASH ${_ffmpeg_msvc_hash}
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/FFMPEG
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down
9 changes: 8 additions & 1 deletion deps/GMP/GMP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ if (IN_GIT_REPO)
endif ()

if (MSVC)
if ((CMAKE_SYSTEM_PROCESSOR MATCHES "^(ARM64|aarch64)$") OR (CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64"))
# Prefer the generator platform (-A ...) over the host processor so that an
# ARM64 host building an x64 (or ARM64EC) target stages the right blobs.
set(_gmp_plat "${CMAKE_GENERATOR_PLATFORM}")
if (NOT _gmp_plat)
set(_gmp_plat "${CMAKE_SYSTEM_PROCESSOR}")
endif ()
string(TOUPPER "${_gmp_plat}" _gmp_plat)
if (_gmp_plat MATCHES "^(ARM64|AARCH64)$")
set(_gmpheader win_arm64/gmp.h)
set(_gmplib win_arm64/libgmp-10.lib)
set(_gmpdll win_arm64/gmp-10.dll)
Expand Down
9 changes: 8 additions & 1 deletion deps/JPEG/JPEG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()

if (MSVC)
if ((CMAKE_SYSTEM_PROCESSOR MATCHES "^(ARM64|aarch64)$") OR (CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64"))
# Generator platform takes precedence over the host processor; SIMD is off
# for ARM64 (no x86 asm) and ARM64EC (deterministic pure-C build).
set(_jpeg_plat "${CMAKE_GENERATOR_PLATFORM}")
if (NOT _jpeg_plat)
set(_jpeg_plat "${CMAKE_SYSTEM_PROCESSOR}")
endif ()
string(TOUPPER "${_jpeg_plat}" _jpeg_plat)
if (_jpeg_plat MATCHES "^(ARM64|AARCH64|ARM64EC)$")
set(_use_SIMD "-DWITH_SIMD=OFF")
endif ()
endif ()
Expand Down
Loading