From b9e1db41a081f58142c5c2c4ef61c74f870aa5fc Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:41 -0300 Subject: [PATCH 01/11] fix: explicit template instantiation for clang-cl in BoundingBox clang-cl does not instantiate BoundingBoxBase::construct for Points::const_iterator through the same transitive path accepted by MSVC. Add the explicit instantiation so the template definition is emitted where the clang-cl build needs it. --- src/libslic3r/BoundingBox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libslic3r/BoundingBox.cpp b/src/libslic3r/BoundingBox.cpp index a2a510b64c..cf5441dace 100644 --- a/src/libslic3r/BoundingBox.cpp +++ b/src/libslic3r/BoundingBox.cpp @@ -8,6 +8,8 @@ namespace Slic3r { template BoundingBoxBase::BoundingBoxBase(const Points &points); +template void BoundingBoxBase::construct<0, BoundingBox, Points::const_iterator>(BoundingBox&, Points::const_iterator, Points::const_iterator); +template void BoundingBoxBase::construct<1, BoundingBox, Points::const_iterator>(BoundingBox&, Points::const_iterator, Points::const_iterator); template BoundingBoxBase::BoundingBoxBase(const std::vector &points); template BoundingBox3Base::BoundingBox3Base(const std::vector &points); From a636243ec03f60effbf79efdae5e0aa9ed197592 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:41 -0300 Subject: [PATCH 02/11] fix: materialize Eigen cast expression before passing to distance_to_squared Eigen's .cast() returns a lazy CwiseUnaryOp expression, not a materialized Matrix. The distance_to_squared overload taking a nearest_point output parameter expects a concrete Eigen::Matrix, so template deduction fails on clang-cl. Materialize the cast into a local Vec variable before passing it. MSVC accepted the expression directly; clang-cl correctly rejects it. --- src/libslic3r/AABBTreeLines.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/AABBTreeLines.hpp b/src/libslic3r/AABBTreeLines.hpp index 97ad1bdf44..b13fe03401 100644 --- a/src/libslic3r/AABBTreeLines.hpp +++ b/src/libslic3r/AABBTreeLines.hpp @@ -32,7 +32,8 @@ namespace AABBTreeLines { { Vec nearest_point; const LineType& line = lines[primitive_index]; - squared_distance = line_alg::distance_to_squared(line, origin.template cast(), &nearest_point); + const Vec origin_cast = origin.template cast(); + squared_distance = line_alg::distance_to_squared(line, origin_cast, &nearest_point); return nearest_point.template cast(); } }; From ec22a58c407b6507fe6dafbaa30ed9380c4ed017 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:42 -0300 Subject: [PATCH 03/11] fix: LabelItemType underlying type to silence narrowing in clang-cl LabelItemType values are used with Marker, which is std::size_t. MSVC accepts the implicit narrowing in this path, but clang-cl diagnoses it more strictly. Give the enum the same underlying type as Marker. --- src/slic3r/GUI/PresetComboBoxes.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/PresetComboBoxes.hpp b/src/slic3r/GUI/PresetComboBoxes.hpp index 53644cecf5..20f75f4616 100644 --- a/src/slic3r/GUI/PresetComboBoxes.hpp +++ b/src/slic3r/GUI/PresetComboBoxes.hpp @@ -39,7 +39,7 @@ public: PresetComboBox(wxWindow* parent, Preset::Type preset_type, const wxSize& size = wxDefaultSize, PresetBundle* preset_bundle = nullptr); ~PresetComboBox(); - enum LabelItemType { + enum LabelItemType : std::size_t { LABEL_ITEM_PHYSICAL_PRINTER = 0xffffff01, LABEL_ITEM_PRINTER_MODELS, LABEL_ITEM_DISABLED, From 9e635925c8d41f76e97f356a35509b738a3ba6f2 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:42 -0300 Subject: [PATCH 04/11] fix: explicit cast T2A_ to const char* for clang-cl clang-cl is stricter about converting the T2A_ helper result in this expression. Cast the conversion helper result explicitly to const char* so the intended string conversion is unambiguous across MSVC and clang-cl. --- src/dev-utils/BaseException.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev-utils/BaseException.cpp b/src/dev-utils/BaseException.cpp index d3f36fcc63..b9054ec21e 100644 --- a/src/dev-utils/BaseException.cpp +++ b/src/dev-utils/BaseException.cpp @@ -69,7 +69,7 @@ void CBaseException::OutputString(LPCTSTR lpszFormat, ...) //WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), szBuf, _tcslen(szBuf), NULL, NULL); //output it to the current directory of binary - std::string output_str = textconv_helper::T2A_(szBuf); + std::string output_str = static_cast(textconv_helper::T2A_(szBuf)); *output_file << output_str; output_file->flush(); } From 7aaeea2bd2b045f90465f7a64e48b3c5540e6478 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:42 -0300 Subject: [PATCH 05/11] fix: wide string literals for url_prefix concatenation on Windows The Windows path builds url_prefix as a wide string. MSVC accepts concatenating the narrow literals here, but clang-cl rejects the mixed narrow/wide expression. Use wide literals so the concatenation type matches. --- src/slic3r/GUI/GUI_App.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index b46273d64a..d3aa486d09 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -9224,7 +9224,7 @@ bool GUI_App::check_url_association(std::wstring url_prefix, std::wstring& reg_b { reg_bin = L""; #ifdef WIN32 - wxRegKey key_full(wxRegKey::HKCU, "Software\\Classes\\" + url_prefix + "\\shell\\open\\command"); + wxRegKey key_full(wxRegKey::HKCU, L"Software\\Classes\\" + url_prefix + L"\\shell\\open\\command"); if (!key_full.Exists()) { return false; } @@ -9250,8 +9250,8 @@ void GUI_App::associate_url(std::wstring url_prefix) wxString key_string = "\"" + wbinary + "\" \"%1\""; - wxRegKey key_first(wxRegKey::HKCU, "Software\\Classes\\" + url_prefix); - wxRegKey key_full(wxRegKey::HKCU, "Software\\Classes\\" + url_prefix + "\\shell\\open\\command"); + wxRegKey key_first(wxRegKey::HKCU, L"Software\\Classes\\" + url_prefix); + wxRegKey key_full(wxRegKey::HKCU, L"Software\\Classes\\" + url_prefix + L"\\shell\\open\\command"); if (!key_first.Exists()) { key_first.Create(false); } @@ -9271,7 +9271,7 @@ void GUI_App::disassociate_url(std::wstring url_prefix) #ifdef WIN32 if (is_running_in_msix()) return; - wxRegKey key_full(wxRegKey::HKCU, "Software\\Classes\\" + url_prefix + "\\shell\\open\\command"); + wxRegKey key_full(wxRegKey::HKCU, L"Software\\Classes\\" + url_prefix + L"\\shell\\open\\command"); if (!key_full.Exists()) { return; } From d865e9e6e13e03ec0020d9529006a7ac750ca6b2 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:59 -0300 Subject: [PATCH 06/11] fix: exclude clang-cl from MSVC-only compiler guards in CMake clang-cl defines MSVC in CMake, but some guarded blocks apply flags or behavior that are specific to cl.exe and should not be passed to clang-cl. Exclude Clang from those MSVC-only branches so clang-cl follows the compatible compiler path instead of inheriting cl.exe-only settings. --- deps_src/clipper2/CMakeLists.txt | 6 +++++- deps_src/miniz/CMakeLists.txt | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/deps_src/clipper2/CMakeLists.txt b/deps_src/clipper2/CMakeLists.txt index c604002da7..86c9a9efab 100644 --- a/deps_src/clipper2/CMakeLists.txt +++ b/deps_src/clipper2/CMakeLists.txt @@ -37,7 +37,11 @@ target_include_directories(Clipper2 ) if (WIN32) - target_compile_options(Clipper2 PRIVATE /W4 /WX) + if (MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(Clipper2 PRIVATE /W4 /WX) + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") + target_compile_options(Clipper2 PRIVATE /W4) + endif() else() target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic -Werror) target_link_libraries(Clipper2 PUBLIC -lm) diff --git a/deps_src/miniz/CMakeLists.txt b/deps_src/miniz/CMakeLists.txt index e02d8a4885..7e060a180f 100644 --- a/deps_src/miniz/CMakeLists.txt +++ b/deps_src/miniz/CMakeLists.txt @@ -11,6 +11,8 @@ add_library(miniz_static STATIC if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") target_compile_definitions(miniz_static PRIVATE _GNU_SOURCE) +elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") + target_compile_options(miniz_static PRIVATE /clang:-Wno-error=incompatible-pointer-types) endif() target_link_libraries(miniz INTERFACE miniz_static) From 0a7ac3f2ac7af58402447fdaea37982dd7ff282d Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:59 -0300 Subject: [PATCH 07/11] fix: disable TBB LTCG to allow linking with lld-link oneTBB enables MSVC IPO/LTCG by default, which emits MSVC proprietary bitcode objects when built with cl.exe. lld-link cannot consume those /GL objects. Patch the TBB MSVC compiler settings so IPO can be disabled and the dependency produces native COFF objects that both link.exe and lld-link can consume. --- deps/TBB/MSVC.cmake | 98 +++++++++++++++++++++++++++++++++++++++++++++ deps/TBB/TBB.cmake | 6 ++- 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 deps/TBB/MSVC.cmake diff --git a/deps/TBB/MSVC.cmake b/deps/TBB/MSVC.cmake new file mode 100644 index 0000000000..d7984bff80 --- /dev/null +++ b/deps/TBB/MSVC.cmake @@ -0,0 +1,98 @@ +# Copyright (c) 2020-2021 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set(TBB_LINK_DEF_FILE_FLAG ${CMAKE_LINK_DEF_FILE_FLAG}) +set(TBB_DEF_FILE_PREFIX win${TBB_ARCH}) + +# Workaround for CMake issue https://gitlab.kitware.com/cmake/cmake/issues/18317. +# TODO: consider use of CMP0092 CMake policy. +string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +set(TBB_WARNING_LEVEL $<$:/W4> $<$:/WX>) + +# Warning suppression C4324: structure was padded due to alignment specifier +set(TBB_WARNING_SUPPRESS /wd4324) +set(TBB_TEST_COMPILE_FLAGS /bigobj) + +if (MSVC_VERSION LESS_EQUAL 1900) + # Warning suppression C4503 for VS2015 and earlier: + # decorated name length exceeded, name was truncated. + # More info can be found at + # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4503 + set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} /wd4503) +endif() + +set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS) +set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS /EHsc) + +# Ignore /WX set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled. +if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag) + tbb_remove_compile_flag(/WX) +endif() + +if (WINDOWS_STORE OR TBB_WINDOWS_DRIVER) + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D_WIN32_WINNT=0x0A00) + set(TBB_COMMON_LINK_FLAGS -NODEFAULTLIB:kernel32.lib -INCREMENTAL:NO) + set(TBB_COMMON_LINK_LIBS OneCore.lib) +endif() + +if (WINDOWS_STORE) + if (NOT CMAKE_SYSTEM_VERSION EQUAL 10.0) + message(FATAL_ERROR "CMAKE_SYSTEM_VERSION must be equal to 10.0") + endif() + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /ZW /ZW:nostdlib) + # CMake define this extra lib, remove it for this build type + string(REGEX REPLACE "WindowsApp.lib" "" CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES}") + + if (TBB_NO_APPCONTAINER) + set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -APPCONTAINER:NO) + endif() +endif() + +if (TBB_WINDOWS_DRIVER) + # Since this is universal driver disable this variable + set(CMAKE_SYSTEM_PROCESSOR "") + # CMake define list additional libs, remove it for this build type + set(CMAKE_CXX_STANDARD_LIBRARIES "") + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D _UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__) +endif() + +if (NOT DEFINED TBB_ENABLE_IPO) + if (DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION) + set(TBB_ENABLE_IPO ${CMAKE_INTERPROCEDURAL_OPTIMIZATION}) + else() + set(TBB_ENABLE_IPO ON) + endif() +endif() + +if (TBB_ENABLE_IPO) + if (CMAKE_CXX_COMPILER_ID MATCHES "(Clang|IntelLLVM)") + if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)") + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg) + endif() + set(TBB_OPENMP_NO_LINK_FLAG TRUE) + set(TBB_IPO_COMPILE_FLAGS $<$>:-flto>) + else() + set(TBB_IPO_COMPILE_FLAGS $<$>:/GL>) + set(TBB_IPO_LINK_FLAGS $<$>:-LTCG> $<$>:-INCREMENTAL:NO>) + endif() +else() + if (CMAKE_CXX_COMPILER_ID MATCHES "(Clang|IntelLLVM)" AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)") + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg) + endif() + set(TBB_IPO_COMPILE_FLAGS "") + set(TBB_IPO_LINK_FLAGS "") +endif() + +set(TBB_OPENMP_FLAG /openmp) diff --git a/deps/TBB/TBB.cmake b/deps/TBB/TBB.cmake index 9b1452d33e..dac2ed63e6 100644 --- a/deps/TBB/TBB.cmake +++ b/deps/TBB/TBB.cmake @@ -1,4 +1,6 @@ -if (FLATPAK AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +if (MSVC) + set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/MSVC.cmake ./cmake/compilers/MSVC.cmake) +elseif (FLATPAK AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake ./cmake/compilers/GNU.cmake) else() set(_patch_command "") @@ -13,6 +15,8 @@ orcaslicer_add_cmake_project( -DTBB_BUILD_SHARED=OFF -DTBB_BUILD_TESTS=OFF -DTBB_TEST=OFF + -DTBB_ENABLE_IPO=OFF + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_DEBUG_POSTFIX=_debug ) From 08128911e32cc70da42045d3d0c516c468d187d3 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:59 -0300 Subject: [PATCH 08/11] fix: copy runtime DLLs for Ninja generator on Windows The runtime DLL copy was nested under CMAKE_CONFIGURATION_TYPES, so it only ran for multi-config generators. Ninja single-config leaves that variable empty, which skipped copying OCCT, GMP, MPFR, WebView2, and freetype DLLs next to the executable. Run the copy logic for both generator styles while keeping it Windows-only. --- src/CMakeLists.txt | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 73c767dad2..6ccd480e3b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -212,14 +212,6 @@ if (WIN32) VERBATIM ) endforeach () - - if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug) - elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") - orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_Release) - else() - orcaslicer_copy_dlls(COPY_DLLS "Release" "" output_dlls_Release) - endif() else () file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/resources" WIN_RESOURCES_SYMLINK) add_custom_command(TARGET OrcaSlicer POST_BUILD @@ -229,6 +221,27 @@ if (WIN32) ) endif () + if (CMAKE_CONFIGURATION_TYPES) + # Multi-config generators (Visual Studio, Ninja Multi-Config): copy per config. + foreach (cfg ${CMAKE_CONFIGURATION_TYPES}) + if ("${cfg}" STREQUAL "Debug") + orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug) + elseif("${cfg}" STREQUAL "RelWithDebInfo") + orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_RelWithDebInfo) + else() + orcaslicer_copy_dlls(COPY_DLLS "${cfg}" "" output_dlls_${cfg}) + endif() + endforeach() + else() + # Single-config generators (Ninja): use CMAKE_BUILD_TYPE. + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug) + elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_RelWithDebInfo) + else() + orcaslicer_copy_dlls(COPY_DLLS "Release" "" output_dlls_Release) + endif() + endif() else () if (APPLE AND NOT CMAKE_MACOSX_BUNDLE) From adb0ca3dc316e216d7eb5dbb60a009c78fd5f95d Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:36:59 -0300 Subject: [PATCH 09/11] fix: use Ninja-compatible build target in build_release_vs.bat ALL_BUILD is a Visual Studio generator target. Ninja uses `all`. When building with -x (Ninja generator), the script fails with "ninja: error: unknown target 'ALL_BUILD'". Use the correct target name for each generator. --- build_release_vs.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_release_vs.bat b/build_release_vs.bat index 3f1a2e0af4..cc3744ae97 100644 --- a/build_release_vs.bat +++ b/build_release_vs.bat @@ -133,7 +133,7 @@ echo on set CMAKE_POLICY_VERSION_MINIMUM=3.5 if "%USE_NINJA%"=="1" ( cmake .. -G %CMAKE_GENERATOR% -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type% - cmake --build . --config %build_type% --target ALL_BUILD + cmake --build . --config %build_type% --target all ) else ( cmake .. -G %CMAKE_GENERATOR% -A x64 -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type% cmake --build . --config %build_type% --target ALL_BUILD -- -m From 5afc6ae9b2f41353d4e8a3be78aa2cc78bda75dc Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:37:00 -0300 Subject: [PATCH 10/11] fix: wxWidgets target path for clang-cl on Windows wxWidgets chooses target files based on the compiler id, which makes clang-cl look under the clang_x64_lib layout. The dependencies are built with MSVC naming/layout, and clang-cl uses the MSVC frontend variant on Windows. Patch the generated wxWidgets config so clang-cl loads the vc_x64_lib targets instead. --- deps/wxWidgets/0001-Clang-CL-fix.patch | 23 +++++++++++++++++++++++ deps/wxWidgets/wxWidgets.cmake | 1 + 2 files changed, 24 insertions(+) create mode 100644 deps/wxWidgets/0001-Clang-CL-fix.patch diff --git a/deps/wxWidgets/0001-Clang-CL-fix.patch b/deps/wxWidgets/0001-Clang-CL-fix.patch new file mode 100644 index 0000000000..4765b67c36 --- /dev/null +++ b/deps/wxWidgets/0001-Clang-CL-fix.patch @@ -0,0 +1,23 @@ +--- + build/cmake/wxWidgetsConfig.cmake.in | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/build/cmake/wxWidgetsConfig.cmake.in b/build/cmake/wxWidgetsConfig.cmake.in +index 1a83f36..70ad8a4 100644 +--- a/build/cmake/wxWidgetsConfig.cmake.in ++++ b/build/cmake/wxWidgetsConfig.cmake.in +@@ -58,7 +58,11 @@ if(WIN32_MSVC_NAMING) + endif() + endif() + +-include("${CMAKE_CURRENT_LIST_DIR}${wxPLATFORM_LIB_DIR}/@PROJECT_NAME@Targets.cmake") ++if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") ++ include("${CMAKE_CURRENT_LIST_DIR}${wxPLATFORM_LIB_DIR}/vc_x64_lib/@PROJECT_NAME@Targets.cmake") ++else() ++ include("${CMAKE_CURRENT_LIST_DIR}${wxPLATFORM_LIB_DIR}/@PROJECT_NAME@Targets.cmake") ++endif() + + macro(wx_inherit_property source dest name) + # property name without _ +-- +2.43.0 diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake index 682b28bac4..a1ed532ef2 100644 --- a/deps/wxWidgets/wxWidgets.cmake +++ b/deps/wxWidgets/wxWidgets.cmake @@ -27,6 +27,7 @@ orcaslicer_add_cmake_project( GIT_TAG v3.3.2 GIT_SHALLOW ON DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${JPEG_PKG} + PATCH_COMMAND git apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-Clang-CL-fix.patch CMAKE_ARGS -DwxBUILD_PRECOMP=ON ${_wx_toolkit} From e840187edc83aee65cf447780edb32749c9b7be1 Mon Sep 17 00:00:00 2001 From: peachismomo Date: Wed, 19 Aug 2026 03:12:56 +0800 Subject: [PATCH 11/11] fix: clang-cl arm64 wxWidgets path and plater desctructor before merging main --- deps/wxWidgets/0001-Clang-CL-fix.patch | 13 +++++++++---- src/slic3r/GUI/Plater.cpp | 2 ++ src/slic3r/GUI/Plater.hpp | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/deps/wxWidgets/0001-Clang-CL-fix.patch b/deps/wxWidgets/0001-Clang-CL-fix.patch index 4765b67c36..23bf23b3f4 100644 --- a/deps/wxWidgets/0001-Clang-CL-fix.patch +++ b/deps/wxWidgets/0001-Clang-CL-fix.patch @@ -1,18 +1,23 @@ --- - build/cmake/wxWidgetsConfig.cmake.in | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) + build/cmake/wxWidgetsConfig.cmake.in | 10 +++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build/cmake/wxWidgetsConfig.cmake.in b/build/cmake/wxWidgetsConfig.cmake.in index 1a83f36..70ad8a4 100644 --- a/build/cmake/wxWidgetsConfig.cmake.in +++ b/build/cmake/wxWidgetsConfig.cmake.in -@@ -58,7 +58,11 @@ if(WIN32_MSVC_NAMING) +@@ -58,7 +58,16 @@ if(WIN32_MSVC_NAMING) endif() endif() -include("${CMAKE_CURRENT_LIST_DIR}${wxPLATFORM_LIB_DIR}/@PROJECT_NAME@Targets.cmake") +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") -+ include("${CMAKE_CURRENT_LIST_DIR}${wxPLATFORM_LIB_DIR}/vc_x64_lib/@PROJECT_NAME@Targets.cmake") ++ if (CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64" OR CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^(ARM64|arm64|aarch64)$") ++ set(_wx_clang_msvc_lib_dir "vc_arm64_lib") ++ else() ++ set(_wx_clang_msvc_lib_dir "vc_x64_lib") ++ endif() ++ include("${CMAKE_CURRENT_LIST_DIR}${wxPLATFORM_LIB_DIR}/${_wx_clang_msvc_lib_dir}/@PROJECT_NAME@Targets.cmake") +else() + include("${CMAKE_CURRENT_LIST_DIR}${wxPLATFORM_LIB_DIR}/@PROJECT_NAME@Targets.cmake") +endif() diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index aecea8f3b8..99c28ed52c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4958,6 +4958,8 @@ private: bool show_warning_dialog { false }; }; +Plater::~Plater() = default; + const std::regex Plater::priv::pattern_bundle(".*[.](amf|amf[.]xml|zip[.]amf|3mf)", std::regex::icase); const std::regex Plater::priv::pattern_3mf(".*3mf", std::regex::icase); const std::regex Plater::priv::pattern_zip_amf(".*[.]zip[.]amf", std::regex::icase); diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index c70c5ca7c1..d8e95bd7d5 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -283,7 +283,7 @@ public: Plater(const Plater &) = delete; Plater &operator=(Plater &&) = delete; Plater &operator=(const Plater &) = delete; - ~Plater() = default; + ~Plater(); bool Show(bool show = true); @@ -978,4 +978,4 @@ wxArrayString get_all_camera_view_type(); } // namespace GUI } // namespace Slic3r -#endif \ No newline at end of file +#endif