[wxwidgets] Update and fix (#25572)

* Revert "[wxwidgets] Remove debug asserts from Release build. (#25240)"

This reverts commit 6e16931acd.

* Update to 3.1.7

* Update installation layout

* Upstream CMake export is not ready for use

* Update versions

* Remove obsolete patch

* Use msvc layout for mingw on windows

* Add debug-support feature

* Update versions

* Fix condition

* Update versions

* Restore symlink patch

* Update versions

* Remove trace option from test port

* Enable testing without feature debug-support

* Fixup defaults for using without debug support

* Expect wxrc-3.1 for mingw cross builds ("unix" layout)

* Update versions
This commit is contained in:
Kai Pastor 2022-07-11 23:06:54 +02:00 committed by GitHub
parent 0c5939ea29
commit 88b3aedb3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 100 additions and 108 deletions

View File

@ -7,8 +7,6 @@ vcpkg_from_github(
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_RELEASE
-DwxBUILD_DEBUG_LEVEL=0
)
vcpkg_cmake_install()

View File

@ -1,6 +1,6 @@
{
"name": "wxcharts",
"version-date": "2022-06-16",
"version-date": "2022-07-05",
"description": "Chart controls for the wxWidgets cross-platform GUI library",
"homepage": "https://www.wxishiko.com/wxCharts",
"license": "MIT",

View File

@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 3.7)
project(wxwidgets-example)
option(wxBUILD_DEBUG_LEVEL "Debug Level" Default)
if(NOT wxBUILD_DEBUG_LEVEL STREQUAL "Default")
add_compile_options("-DwxDEBUG_LEVEL=${wxBUILD_DEBUG_LEVEL}")
endif()
add_executable(main WIN32 popup.cpp)
find_package(wxWidgets REQUIRED)

View File

@ -1,5 +1,18 @@
diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake
index b5175236e2..8c9275974f 100644
index 32bd959..74f31ed 100644
--- a/build/cmake/functions.cmake
+++ b/build/cmake/functions.cmake
@@ -418,7 +418,7 @@ macro(wx_add_library name)
set_target_properties(${name} PROPERTIES PROJECT_LABEL ${name_short})
# Setup install
- set(runtime_dir "lib")
+ set(runtime_dir "bin")
if(WIN32 AND NOT WIN32_MSVC_NAMING)
# configure puts the .dll in the bin directory
set(runtime_dir "bin")
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index 3ff14ab..7bd00d3 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -146,7 +146,7 @@ if(WIN32)
@ -7,24 +20,12 @@ index b5175236e2..8c9275974f 100644
endif()
-if(WIN32_MSVC_NAMING)
+if(WIN32_MSVC_NAMING AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR)
+if(0)
if(wxBUILD_SHARED)
set(lib_suffix "_dll")
else()
index 9e6aafa900..defd196d2e 100644
--- a/build/cmake/functions.cmake
+++ b/build/cmake/functions.cmake
@@ -417,7 +417,7 @@ macro(wx_add_library name)
# Setup install
set(runtime_dir "lib")
- if(WIN32 AND NOT WIN32_MSVC_NAMING)
+ if(VCPKG_TOOLCHAIN OR (WIN32 AND NOT WIN32_MSVC_NAMING))
# configure puts the .dll in the bin directory
set(runtime_dir "bin")
endif()
diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake
index 7902646ef4..04ccd1aba7 100644
index 84cb9f5..e2f460a 100644
--- a/build/cmake/install.cmake
+++ b/build/cmake/install.cmake
@@ -48,7 +48,7 @@ else()
@ -37,10 +38,10 @@ index 7902646ef4..04ccd1aba7 100644
${CMAKE_INSTALL_PREFIX}/bin/wx-config \
)"
diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt
index 2b3a22834d..e0e964db9d 100644
index d6b3465..870897b 100644
--- a/build/cmake/utils/CMakeLists.txt
+++ b/build/cmake/utils/CMakeLists.txt
@@ -41,7 +41,7 @@ if(wxUSE_XRC)
@@ -38,7 +38,7 @@ if(wxUSE_XRC)
endif()
install(CODE "execute_process( \

View File

@ -1,21 +0,0 @@
diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake
index 902b7c5..ad8d1c4 100644
--- a/build/cmake/functions.cmake
+++ b/build/cmake/functions.cmake
@@ -184,7 +184,6 @@ function(wx_set_target_properties target_name is_base)
set_target_properties(${target_name}
PROPERTIES
OUTPUT_NAME "wx_${lib_toolkit}${lib_unicode}${lib_flavour}${lib_suffix}-${lib_version}"
- OUTPUT_NAME_DEBUG "wx_${lib_toolkit}${lib_unicode}d${lib_flavour}${lib_suffix}-${lib_version}"
PREFIX "lib"
)
endif()
@@ -486,7 +485,7 @@ function(wx_set_builtin_target_properties target_name)
PROPERTIES
OUTPUT_NAME ${target_name}${lib_unicode}${postfix}
)
- if(WIN32)
+ if(WIN32 AND NOT MINGW)
set_target_properties(${target_name}
PROPERTIES
OUTPUT_NAME_DEBUG ${target_name}${lib_unicode}d

View File

@ -1,35 +1,29 @@
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index 8c9275974f..3758261299 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -615,3 +615,6 @@ if(wxBUILD_PRECOMP)
wx_option_force_value(wxBUILD_PRECOMP OFF)
endif()
endif(wxBUILD_PRECOMP)
+
+find_package(unofficial-nanosvg CONFIG REQUIRED)
+list(APPEND wxTOOLKIT_LIBRARIES unofficial::nanosvg::nanosvg)
diff --git a/src/generic/bmpsvg.cpp b/src/generic/bmpsvg.cpp
index 76f20dce4c..7a7c24b4dd 100644
--- a/src/generic/bmpsvg.cpp
+++ b/src/generic/bmpsvg.cpp
@@ -26,7 +26,7 @@
// your source tree doesn't contain 3rdparty/nanosvg and you should initialize
// and update the corresponding submodule.
#ifdef __has_include
- #if ! __has_include("../../3rdparty/nanosvg/src/nanosvg.h")
+ #if 0
#error You need to run "git submodule update --init 3rdparty/nanosvg".
#undef wxHAS_SVG
#endif
@@ -60,8 +60,8 @@
#define NANOSVG_IMPLEMENTATION
#define NANOSVGRAST_IMPLEMENTATION
#define NANOSVG_ALL_COLOR_KEYWORDS
-#include "../../3rdparty/nanosvg/src/nanosvg.h"
-#include "../../3rdparty/nanosvg/src/nanosvgrast.h"
+#include <nanosvg.h>
+#include <nanosvgrast.h>
#ifdef __VISUALC__
#pragma warning(pop)
diff --git a/build/cmake/lib/nanosvg.cmake b/build/cmake/lib/nanosvg.cmake
index 401bf48..b9e4b57 100644
--- a/build/cmake/lib/nanosvg.cmake
+++ b/build/cmake/lib/nanosvg.cmake
@@ -16,9 +16,9 @@ elseif(wxUSE_NANOSVG)
set(NANOSVG_INCLUDE_DIRS )
set(wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL TRUE)
- find_package(NanoSVG REQUIRED)
+ find_package(unofficial-nanosvg CONFIG REQUIRED)
- foreach(TARGETNAME NanoSVG::nanosvg NanoSVG::nanosvgrast unofficial::nanosvg)
+ foreach(TARGETNAME unofficial::nanosvg::nanosvg)
if(NOT TARGET ${TARGETNAME})
continue()
endif()
diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake
index 49c536a..5630526 100644
--- a/build/cmake/options.cmake
+++ b/build/cmake/options.cmake
@@ -114,7 +114,7 @@ wx_add_thirdparty_library(wxUSE_EXPAT EXPAT "use expat for XML parsing" DEFAULT_
wx_add_thirdparty_library(wxUSE_LIBJPEG JPEG "use libjpeg (JPEG file format)")
wx_add_thirdparty_library(wxUSE_LIBPNG PNG "use libpng (PNG image format)")
wx_add_thirdparty_library(wxUSE_LIBTIFF TIFF "use libtiff (TIFF file format)")
-wx_add_thirdparty_library(wxUSE_NANOSVG NanoSVG "use NanoSVG for rasterizing SVG")
+wx_add_thirdparty_library(wxUSE_NANOSVG unofficial-nanosvg "use NanoSVG for rasterizing SVG")
wx_option(wxUSE_LIBLZMA "use LZMA compression" OFF)
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBLZMA "use liblzma for LZMA compression")

View File

@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wxWidgets/wxWidgets
REF 35a6d7b15fedfdb5198bb6c28b31cda33b2c2a76 #v3.1.6-final
SHA512 f42b97a695e037130da9935e3abf117c0720325f194fcdabace95fa16a5ca06d49e35db9616bb0ef16600044397739459551a6276f3c239bd4fc160ecb6cdc16
REF v3.1.7
SHA512 d6c9613b82a7e697b60217ba8fe9be4406ce7fad1f8d2d16cbf94c9aa9b5a38f1f3e175cb7a80dac8a57196dd6aa2fc3db83b4099a4257bb1a79707002db4af2
HEAD_REF master
PATCHES
install-layout.patch
@ -38,6 +38,11 @@ vcpkg_check_features(
vcpkg_find_acquire_program(PKGCONFIG)
set(OPTIONS_RELEASE "")
if(NOT "debug-support" IN_LIST FEATURES)
list(APPEND OPTIONS_RELEASE "-DwxBUILD_DEBUG_LEVEL=0")
endif()
set(OPTIONS "")
if(VCPKG_TARGET_IS_OSX)
list(APPEND OPTIONS -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=9999)
@ -89,8 +94,8 @@ vcpkg_cmake_configure(
-DwxUSE_LIBJPEG=sys
-DwxUSE_LIBPNG=sys
-DwxUSE_LIBTIFF=sys
-DwxUSE_NANOSVG=sys
-DwxUSE_SECRETSTORE=FALSE
-DwxBUILD_DISABLE_PLATFORM_LIB_DIR=ON
-DwxUSE_STL=${WXWIDGETS_USE_STL}
-DwxUSE_STD_CONTAINERS=${WXWIDGETS_USE_STD_CONTAINERS}
${OPTIONS}
@ -99,13 +104,19 @@ vcpkg_cmake_configure(
# however, we need to declare that the minimum cmake version requirement is at least 3.1 to use CMAKE_PREFIX_PATH as the path to find .pc.
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
OPTIONS_RELEASE
-DwxBUILD_DEBUG_LEVEL=0
${OPTIONS_RELEASE}
)
vcpkg_cmake_install()
# The CMake export is not ready for use: It lacks a config file.
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/lib/cmake
${CURRENT_PACKAGES_DIR}/debug/lib/cmake
)
set(tools wxrc)
if(VCPKG_TARGET_IS_MINGW OR NOT VCPKG_TARGET_IS_WINDOWS)
if(NOT VCPKG_TARGET_IS_WINDOWS OR NOT VCPKG_HOST_IS_WINDOWS)
list(APPEND tools wxrc-3.1)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/wx-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/wx-config")
@ -176,6 +187,14 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h")
)
endif()
if(NOT "debug-support" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_HOST_IS_WINDOWS)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/wx/debug.h" "#define wxDEBUG_LEVEL 1" "#define wxDEBUG_LEVEL 0")
else()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/wx-3.1/wx/debug.h" "#define wxDEBUG_LEVEL 1" "#define wxDEBUG_LEVEL 0")
endif()
endif()
if("example" IN_LIST FEATURES)
file(INSTALL
"${CMAKE_CURRENT_LIST_DIR}/example/CMakeLists.txt"

View File

@ -7,18 +7,11 @@ set(wxWidgets_ROOT_DIR "${_vcpkg_wx_root}" CACHE INTERNAL "")
set(WX_ROOT_DIR "${_vcpkg_wx_root}" CACHE INTERNAL "")
unset(_vcpkg_wx_root)
if(MINGW)
# Force FindwxWidgets.cmake unix mode, matching mingw install layout
set(_vcpkg_wxwidgets_backup_crosscompiling "${CMAKE_CROSSCOMPILING}")
set(CMAKE_CROSSCOMPILING 1)
elseif(WIN32)
# Force FindwxWidgets.cmake win32 mode, matching win32 install layout
if(WIN32 AND CMAKE_HOST_WIN32)
# FindwxWidgets.cmake win32 mode, multi-config
# Force FindwxWidgets.cmake win32 mode for all windows targets built on windows
set(_vcpkg_wxwidgets_backup_crosscompiling "${CMAKE_CROSSCOMPILING}")
set(CMAKE_CROSSCOMPILING 0)
endif()
if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
# FindwxWidgets.cmake win32 mode, multi-config
# 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 "")
@ -30,6 +23,11 @@ if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
set(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/lib" CACHE INTERNAL "")
else()
# FindwxWidgets.cmake unix mode, single-config
if(MINGW)
# Force FindwxWidgets.cmake unix mode for mingw cross builds
set(_vcpkg_wxwidgets_backup_crosscompiling "${CMAKE_CROSSCOMPILING}")
set(CMAKE_CROSSCOMPILING 1)
endif()
set(_vcpkg_wxconfig "")
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR "Debug" IN_LIST MAP_IMPORTED_CONFIG_${CMAKE_BUILD_TYPE})
# Debug
@ -53,7 +51,7 @@ if(DEFINED _vcpkg_wxwidgets_backup_crosscompiling)
unset(_vcpkg_wxwidgets_backup_crosscompiling)
endif()
if(WIN32 AND NOT MINGW AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
if(WIN32 AND CMAKE_HOST_WIN32 AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
find_package(EXPAT QUIET)
find_package(JPEG QUIET)
find_package(PNG QUIET)

View File

@ -1,7 +1,6 @@
{
"name": "wxwidgets",
"version": "3.1.6",
"port-version": 2,
"version": "3.1.7",
"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.",
@ -26,16 +25,16 @@
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"default-features": [
"debug-support",
"sound"
],
"features": {
"debug-support": {
"description": "Enable wxWidgets debugging support hooks even for release builds (wxDEBUG_LEVEL 1)"
},
"example": {
"description": "Example source code and CMake project"
},

View File

@ -12,8 +12,6 @@ vcpkg_cmake_configure(
${OPTIONS}
-DCMAKE_CONFIG_RUN=1
"-DPRINT_VARS=CMAKE_CONFIG_RUN;wxWidgets_LIBRARIES"
OPTIONS_RELEASE
-DwxBUILD_DEBUG_LEVEL=0
)
vcpkg_cmake_build()

View File

@ -9,6 +9,7 @@
},
{
"name": "wxwidgets",
"default-features": false,
"features": [
"example"
]

View File

@ -7641,12 +7641,12 @@
"port-version": 0
},
"wxcharts": {
"baseline": "2022-06-16",
"baseline": "2022-07-05",
"port-version": 0
},
"wxwidgets": {
"baseline": "3.1.6",
"port-version": 2
"baseline": "3.1.7",
"port-version": 0
},
"x-plane": {
"baseline": "3.0.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "03603fb0a73094f361edd6b4f074b661654a19b2",
"version-date": "2022-07-05",
"port-version": 0
},
{
"git-tree": "0d4c30893a28468249d63c0f4c1a1a9e231ac817",
"version-date": "2022-06-16",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "2610601e9e585455bc709f29636f79b5ad9382a2",
"version": "3.1.7",
"port-version": 0
},
{
"git-tree": "27a68f45cbdc9ab88864c353c7a8b91f76153509",
"version": "3.1.6",