From bdbaccd542a8d5fc4e24ca173d8c5a68780ac4fd Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Wed, 29 Oct 2025 14:14:21 +0100 Subject: [PATCH] Rebase wxwidgets overlay with upstream vcpkg port --- .../wxwidgets/example/CMakeLists.txt | 2 + .../wxwidgets/install-layout.patch | 21 ++++++---- .../wxwidgets/portfile.cmake | 41 +++++++++++++++---- .../wxwidgets/vcpkg-cmake-wrapper.cmake | 2 +- vcpkg.json | 8 +--- 5 files changed, 52 insertions(+), 22 deletions(-) diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/example/CMakeLists.txt b/dependencies/vcpkg_overlay_ports/wxwidgets/example/CMakeLists.txt index 229b7107..11d30848 100644 --- a/dependencies/vcpkg_overlay_ports/wxwidgets/example/CMakeLists.txt +++ b/dependencies/vcpkg_overlay_ports/wxwidgets/example/CMakeLists.txt @@ -5,6 +5,7 @@ project(wxwidgets-example) add_executable(main WIN32 popup.cpp) find_package(wxWidgets REQUIRED) +target_compile_features(main PRIVATE cxx_std_11) target_compile_definitions(main PRIVATE ${wxWidgets_DEFINITIONS} "$<$:${wxWidgets_DEFINITIONS_DEBUG}>") target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS}) target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES}) @@ -13,6 +14,7 @@ add_executable(main2 WIN32 popup.cpp) find_package(wxWidgets CONFIG REQUIRED) target_link_libraries(main2 PRIVATE wx::core wx::base) +target_compile_features(main2 PRIVATE cxx_std_11) option(USE_WXRC "Use the wxrc resource compiler" ON) if(USE_WXRC) diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/install-layout.patch b/dependencies/vcpkg_overlay_ports/wxwidgets/install-layout.patch index 6ec4db46..3a8b5459 100644 --- a/dependencies/vcpkg_overlay_ports/wxwidgets/install-layout.patch +++ b/dependencies/vcpkg_overlay_ports/wxwidgets/install-layout.patch @@ -1,16 +1,23 @@ diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake -index f044d22d4d..48fc5ad072 100644 +index f044d22d4d..a78b9aa1e9 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake -@@ -198,7 +198,7 @@ if(WIN32) - endif() - endif() +@@ -200,12 +200,12 @@ endif() --if(WIN32_MSVC_NAMING) -+if(0) + if(WIN32_MSVC_NAMING) if(wxBUILD_SHARED) - set(lib_suffix "_dll") +- set(lib_suffix "_dll") ++ # set(lib_suffix "_dll") else() +- set(lib_suffix "_lib") ++ # set(lib_suffix "_lib") + endif() + +- set(wxPLATFORM_LIB_DIR "${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}${lib_suffix}") ++ # set(wxPLATFORM_LIB_DIR "${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}${lib_suffix}") + + # Generator expression to not create different Debug and Release directories + set(GEN_EXPR_DIR "$<1:/>") diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake index a373983043..2e1ace7bf9 100644 --- a/build/cmake/install.cmake diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/portfile.cmake b/dependencies/vcpkg_overlay_ports/wxwidgets/portfile.cmake index 12491480..8c42132d 100644 --- a/dependencies/vcpkg_overlay_ports/wxwidgets/portfile.cmake +++ b/dependencies/vcpkg_overlay_ports/wxwidgets/portfile.cmake @@ -12,9 +12,26 @@ vcpkg_from_github( fix-pcre2.patch gtk3-link-libraries.patch sdl2.patch - fix-dark-mode-offset.patch ) +# Submodule dependencies +vcpkg_from_github( + OUT_SOURCE_PATH lexilla_SOURCE_PATH + REPO wxWidgets/lexilla + REF "27c20a6ae5eebf418debeac0166052ed6fb653bc" + SHA512 7e5de7f664509473b691af8261fca34c2687772faca7260eeba5f2984516e6f8edf88c27192e056c9dda996e2ad2c20f6d1dff1c4bd2f3c0d74852cb50ca424a + HEAD_REF wx +) +file(COPY "${lexilla_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/stc/lexilla") +vcpkg_from_github( + OUT_SOURCE_PATH scintilla_SOURCE_PATH + REPO wxWidgets/scintilla + REF "0b90f31ced23241054e8088abb50babe9a44ae67" + SHA512 db1f3007f4bd8860fad0817b6cf87980a4b713777025128cf5caea8d6d17b6fafe23fd22ff6886d7d5a420f241d85b7502b85d7e52b4ddb0774edc4b0a0203e7 + HEAD_REF wx +) +file(COPY "${scintilla_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/stc/scintilla") + vcpkg_check_features( OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES @@ -52,14 +69,20 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() endif() +if("webview" IN_LIST FEATURES AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND OPTIONS -DwxUSE_WEBVIEW_EDGE_STATIC=ON) +endif() + vcpkg_find_acquire_program(PKGCONFIG) # This may be set to ON by users in a custom triplet. -# The use of 'wxUSE_STL' and 'WXWIDGETS_USE_STD_CONTAINERS' (ON or OFF) are not API compatible -# which is why they must be set in a custom triplet rather than a port feature. +# The use of 'WXWIDGETS_USE_STD_CONTAINERS' (ON or OFF) is not API compatible +# which is why it must be set in a custom triplet rather than a port feature. +# For backwards compatibility, we also replace 'wxUSE_STL' (which no longer +# exists) with 'wxUSE_STD_STRING_CONV_IN_WXSTRING' which still exists and was +# set by `wxUSE_STL` previously. if(NOT DEFINED WXWIDGETS_USE_STL) set(WXWIDGETS_USE_STL OFF) - set(WXWIDGETS_USE_STD_STRING_CONV_IN_WXSTRING OFF) endif() if(NOT DEFINED WXWIDGETS_USE_STD_CONTAINERS) @@ -70,19 +93,18 @@ vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} - -DwxUSE_STC=OFF -DwxUSE_REGEX=sys -DwxUSE_ZLIB=sys -DwxUSE_EXPAT=sys -DwxUSE_LIBJPEG=sys -DwxUSE_LIBPNG=sys -DwxUSE_LIBTIFF=sys - -DwxUSE_LIBWEBP=sys -DwxUSE_NANOSVG=sys + -DwxUSE_LIBWEBP=sys -DwxUSE_GLCANVAS=ON -DwxUSE_LIBGNOMEVFS=OFF -DwxUSE_LIBNOTIFY=OFF - -DwxUSE_STD_STRING_CONV_IN_WXSTRING=${WXWIDGETS_USE_STD_STRING_CONV_IN_WXSTRING} + -DwxUSE_STD_STRING_CONV_IN_WXSTRING=${WXWIDGETS_USE_STL} -DwxUSE_STD_CONTAINERS=${WXWIDGETS_USE_STD_CONTAINERS} -DwxUSE_UIACTIONSIMULATOR=OFF -DCMAKE_DISABLE_FIND_PACKAGE_GSPELL=ON @@ -126,6 +148,11 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/msvc") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/mswu") +if(VCPKG_BUILD_TYPE STREQUAL "release") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/mswud") +endif() + file(GLOB_RECURSE INCLUDES "${CURRENT_PACKAGES_DIR}/include/*.h") if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h") list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h") diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/vcpkg-cmake-wrapper.cmake b/dependencies/vcpkg_overlay_ports/wxwidgets/vcpkg-cmake-wrapper.cmake index 635b509b..bcbc0855 100644 --- a/dependencies/vcpkg_overlay_ports/wxwidgets/vcpkg-cmake-wrapper.cmake +++ b/dependencies/vcpkg_overlay_ports/wxwidgets/vcpkg-cmake-wrapper.cmake @@ -9,7 +9,7 @@ set(WX_ROOT_DIR "${_vcpkg_wx_root}" CACHE INTERNAL "") unset(_vcpkg_wx_root) if(WIN32) - # Find all libs with "32" infix which is unknown to FindwxWidgets.cmake + # Find all libs with "33" infix which is unknown to FindwxWidgets.cmake function(z_vcpkg_wxwidgets_find_base_library BASENAME) find_library(WX_${BASENAME}d wx${BASENAME}33ud NAMES wx${BASENAME}d PATHS "${wxWidgets_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(WX_${BASENAME} wx${BASENAME}33u NAMES wx${BASENAME} PATHS "${wxWidgets_ROOT_DIR}/lib" NO_DEFAULT_PATH REQUIRED) diff --git a/vcpkg.json b/vcpkg.json index 8ee42a4f..4d34981d 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -34,13 +34,7 @@ "default-features": false }, "zstd", - { - "name": "wxwidgets", - "features": [ - "debug-support" - ], - "default-features": false - }, + "wxwidgets", "openssl", { "name": "curl",