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.
This commit is contained in:
Gabriel
2026-06-24 00:37:00 -03:00
parent adb0ca3dc3
commit 5afc6ae9b2
2 changed files with 24 additions and 0 deletions

23
deps/wxWidgets/0001-Clang-CL-fix.patch vendored Normal file
View File

@@ -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 _<CONFIG>
--
2.43.0

View File

@@ -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}