fix Windows build errors - wip

This commit is contained in:
SoftFever
2026-03-26 10:17:19 +08:00
parent 67fb0c8c83
commit fd47370c5c
3 changed files with 17 additions and 4 deletions

View File

@@ -59,12 +59,23 @@ orcaslicer_add_cmake_project(
# wxWidgets 3.3 cmake install doesn't include private headers.
# OrcaSlicer uses some of the private headers (for accessibility support).
# Copy the private headers directory after install.
if(MSVC)
set(_wx_inc_dest ${DESTDIR}/include/wx)
else()
set(_wx_inc_dest ${DESTDIR}/include/wx-3.3/wx)
endif()
ExternalProject_Add_Step(dep_wxWidgets copy_private_headers
DEPENDEES install
COMMENT "Copying wxWidgets private headers"
COMMAND ${CMAKE_COMMAND} -E copy_directory
<SOURCE_DIR>/include/wx/private
${DESTDIR}/include/wx-3.3/wx/private
${_wx_inc_dest}/private
COMMAND ${CMAKE_COMMAND} -E copy_directory
<SOURCE_DIR>/include/wx/generic/private
${_wx_inc_dest}/generic/private
COMMAND ${CMAKE_COMMAND} -E copy_directory
<SOURCE_DIR>/include/wx/gtk/private
${_wx_inc_dest}/gtk/private
)
if (MSVC)

View File

@@ -32,14 +32,16 @@ if (SLIC3R_GUI)
set (wxWidgets_CONFIG_OPTIONS "--toolkit=gtk${SLIC3R_GTK}")
find_package(wxWidgets 3.3 REQUIRED COMPONENTS base core adv html gl aui net media webview)
else ()
find_package(wxWidgets 3.3 REQUIRED COMPONENTS html adv gl core base webview aui net media)
find_package(wxWidgets 3.3 CONFIG REQUIRED COMPONENTS html adv gl core base webview aui net media)
endif ()
if(UNIX)
message(STATUS "wx-config path: ${wxWidgets_CONFIG_EXECUTABLE}")
endif()
if(wxWidgets_USE_FILE)
include(${wxWidgets_USE_FILE})
endif()
find_package(JPEG QUIET)

View File

@@ -329,7 +329,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
bool WebView::CheckWebViewRuntime()
{
wxWebViewFactoryEdge factory;
auto wxVersion = factory.GetVersionInfo();
auto wxVersion = factory.GetVersionInfo(wxVersionContext::RunTime);
return wxVersion.GetMajor() != 0;
}