From 5afc6ae9b2f41353d4e8a3be78aa2cc78bda75dc Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Jun 2026 00:37:00 -0300 Subject: [PATCH] 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}