From e59f7400c331b4abc82049e80f6f5482f52629f7 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 27 Jul 2022 20:51:32 +0200 Subject: [PATCH] [wxwidgets] Update to 3.2 (#25943) * Update wxwidgets to 3.2.0 * Update portfile * Update wrapper for win32 * [cmake-user] Test wxwidgets on mingw * Fixup cmake config * Updated nanosvg patch * Handle search path for gtk3 link libs * Update versions * Remove obsolete option * Cleanup pkg-config setup * Update versions Co-authored-by: Tal Regev --- ports/wxwidgets/example/CMakeLists.txt | 5 ++++ ports/wxwidgets/gtk3-link-libraries.patch | 12 ++++++++++ ports/wxwidgets/install-layout.patch | 2 +- ports/wxwidgets/nanosvg-ext-depend.patch | 13 +++++++++++ ports/wxwidgets/portfile.cmake | 27 +++++++++++----------- ports/wxwidgets/usage | 8 +++---- ports/wxwidgets/vcpkg-cmake-wrapper.cmake | 28 +++++++++++++++-------- ports/wxwidgets/vcpkg.json | 6 ++++- scripts/test_ports/cmake-user/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/w-/wxwidgets.json | 5 ++++ 11 files changed, 77 insertions(+), 33 deletions(-) create mode 100644 ports/wxwidgets/gtk3-link-libraries.patch diff --git a/ports/wxwidgets/example/CMakeLists.txt b/ports/wxwidgets/example/CMakeLists.txt index 7d5b12dba4cdbe..229b7107a07936 100644 --- a/ports/wxwidgets/example/CMakeLists.txt +++ b/ports/wxwidgets/example/CMakeLists.txt @@ -9,6 +9,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}) + find_package(wxWidgets CONFIG REQUIRED) + target_link_libraries(main PRIVATE wx::core wx::base) diff --git a/ports/wxwidgets/vcpkg-cmake-wrapper.cmake b/ports/wxwidgets/vcpkg-cmake-wrapper.cmake index cbdd338090f6cf..5737945d08d139 100644 --- a/ports/wxwidgets/vcpkg-cmake-wrapper.cmake +++ b/ports/wxwidgets/vcpkg-cmake-wrapper.cmake @@ -8,18 +8,26 @@ set(WX_ROOT_DIR "${_vcpkg_wx_root}" CACHE INTERNAL "") unset(_vcpkg_wx_root) if(WIN32 AND CMAKE_HOST_WIN32) - # FindwxWidgets.cmake win32 mode, multi-config + # Find all libs with "32" infix which is unknown to FindwxWidgets.cmake + function(z_vcpkg_wxwidgets_find_base_library BASENAME) + find_library(WX_${BASENAME}d wx${BASENAME}32ud NAMES wx${BASENAME}d PATHS "${wxWidgets_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) + find_library(WX_${BASENAME} wx${BASENAME}32u NAMES wx${BASENAME} PATHS "${wxWidgets_ROOT_DIR}/lib" NO_DEFAULT_PATH REQUIRED) + endfunction() + function(z_vcpkg_wxwidgets_find_suffix_library BASENAME) + foreach(lib IN LISTS ARGN) + find_library(WX_${lib}d NAMES wx${BASENAME}32ud_${lib} PATHS "${wxWidgets_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) + find_library(WX_${lib} NAMES wx${BASENAME}32u_${lib} PATHS "${wxWidgets_ROOT_DIR}/lib" NO_DEFAULT_PATH) + endforeach() + endfunction() + z_vcpkg_wxwidgets_find_base_library(base) + z_vcpkg_wxwidgets_find_suffix_library(base net odbc xml) + z_vcpkg_wxwidgets_find_suffix_library(msw core adv aui html media xrc dbgrid gl qa richtext stc ribbon propgrid webview) + if(WX_stc AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") + z_vcpkg_wxwidgets_find_base_library(scintilla) + endif() # Force FindwxWidgets.cmake win32 mode for all windows targets built on windows set(_vcpkg_wxwidgets_backup_crosscompiling "${CMAKE_CROSSCOMPILING}") set(CMAKE_CROSSCOMPILING 0) - # Get cache variables for debug libs - set(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/debug/lib" CACHE INTERNAL "") - set(WX_LIB_DIR "${wxWidgets_LIB_DIR}" CACHE INTERNAL "") - _find_package(${ARGS}) - # Reset for regular lookup - unset(wxWidgets_CONFIGURATION CACHE) - unset(wxWidgets_USE_REL_AND_DBG CACHE) - set(WX_CONFIGURATION_LIST "") set(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/lib" CACHE INTERNAL "") else() # FindwxWidgets.cmake unix mode, single-config @@ -51,7 +59,7 @@ if(DEFINED _vcpkg_wxwidgets_backup_crosscompiling) unset(_vcpkg_wxwidgets_backup_crosscompiling) endif() -if(WIN32 AND CMAKE_HOST_WIN32 AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") +if(WIN32 AND CMAKE_HOST_WIN32 AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT "wx::core" IN_LIST wxWidgets_LIBRARIES) find_package(EXPAT QUIET) find_package(JPEG QUIET) find_package(PNG QUIET) diff --git a/ports/wxwidgets/vcpkg.json b/ports/wxwidgets/vcpkg.json index 2075c208508457..54eeafebf54a5a 100644 --- a/ports/wxwidgets/vcpkg.json +++ b/ports/wxwidgets/vcpkg.json @@ -1,6 +1,6 @@ { "name": "wxwidgets", - "version": "3.1.7", + "version": "3.2.0", "description": [ "Widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. ", "Set WXWIDGETS_USE_STL in a custom triplet to build with the wxUSE_STL build option.", @@ -25,6 +25,10 @@ "name": "vcpkg-cmake", "host": true }, + { + "name": "vcpkg-cmake-config", + "host": true + }, "zlib" ], "default-features": [ diff --git a/scripts/test_ports/cmake-user/vcpkg.json b/scripts/test_ports/cmake-user/vcpkg.json index 70d44b9f3a41e0..8b476c587b046c 100644 --- a/scripts/test_ports/cmake-user/vcpkg.json +++ b/scripts/test_ports/cmake-user/vcpkg.json @@ -122,7 +122,7 @@ "$package": "wxWidgets", "name": "wxwidgets", "default-features": false, - "platform": "!linux & !mingw & !uwp" + "platform": "!linux & !uwp" }, { "$package": "ZLIB", diff --git a/versions/baseline.json b/versions/baseline.json index b8fdb99d21c875..b8f1d7ab68017f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7673,7 +7673,7 @@ "port-version": 0 }, "wxwidgets": { - "baseline": "3.1.7", + "baseline": "3.2.0", "port-version": 0 }, "x-plane": { diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json index 41c90fb00f0fc7..de0d1ba03679b1 100644 --- a/versions/w-/wxwidgets.json +++ b/versions/w-/wxwidgets.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "204fda7008c12569ddf44a935b32bbe5df87cef4", + "version": "3.2.0", + "port-version": 0 + }, { "git-tree": "2610601e9e585455bc709f29636f79b5ad9382a2", "version": "3.1.7",