Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wxwidgets] Update and fix #25572

Merged
merged 18 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ports/wxcharts/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ vcpkg_from_github(

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_RELEASE
-DwxBUILD_DEBUG_LEVEL=0
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
)

vcpkg_cmake_install()
Expand Down
2 changes: 1 addition & 1 deletion ports/wxcharts/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 0 additions & 5 deletions ports/wxwidgets/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
55 changes: 15 additions & 40 deletions ports/wxwidgets/install-layout.patch
Original file line number Diff line number Diff line change
@@ -1,51 +1,26 @@
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)
endif()
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
--- a/build/cmake/install.cmake
+++ b/build/cmake/install.cmake
@@ -48,7 +48,7 @@ else()

install(DIRECTORY DESTINATION "bin")
install(CODE "execute_process( \
- COMMAND ${CMAKE_COMMAND} -E create_symlink \
+ COMMAND ${CMAKE_COMMAND} -E copy \
${CMAKE_INSTALL_PREFIX}/lib/wx/config/${wxBUILD_FILE_ID} \
${CMAKE_INSTALL_PREFIX}/bin/wx-config \
)"
diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt
index 2b3a22834d..e0e964db9d 100644
--- a/build/cmake/utils/CMakeLists.txt
+++ b/build/cmake/utils/CMakeLists.txt
@@ -41,7 +41,7 @@ if(wxUSE_XRC)
endif()

install(CODE "execute_process( \
- COMMAND ${CMAKE_COMMAND} -E create_symlink \
+ COMMAND ${CMAKE_COMMAND} -E copy \
${CMAKE_INSTALL_PREFIX}/bin/${wxrc_output_name}${EXE_SUFFIX} \
${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
)"
21 changes: 0 additions & 21 deletions ports/wxwidgets/mingw-output-name.patch

This file was deleted.

64 changes: 29 additions & 35 deletions ports/wxwidgets/nanosvg-ext-depend.patch
Original file line number Diff line number Diff line change
@@ -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")
21 changes: 16 additions & 5 deletions ports/wxwidgets/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -38,6 +38,11 @@ vcpkg_check_features(

vcpkg_find_acquire_program(PKGCONFIG)

set(OPTIONS_RELEASE "")
if("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)
Expand Down Expand Up @@ -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}
Expand All @@ -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)
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")
Expand Down
20 changes: 9 additions & 11 deletions ports/wxwidgets/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand All @@ -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
Expand All @@ -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)
Expand Down
11 changes: 5 additions & 6 deletions ports/wxwidgets/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand All @@ -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"
},
Expand Down
2 changes: 0 additions & 2 deletions scripts/test_ports/vcpkg-ci-wxwidgets/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7637,12 +7637,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",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wxcharts.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "03603fb0a73094f361edd6b4f074b661654a19b2",
"version-date": "2022-07-05",
"port-version": 0
},
{
"git-tree": "0d4c30893a28468249d63c0f4c1a1a9e231ac817",
"version-date": "2022-06-16",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wxwidgets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "76ab811cdc91bcb7de289cfe0ac3ea6cfb3ef9ea",
"version": "3.1.7",
"port-version": 0
},
{
"git-tree": "27a68f45cbdc9ab88864c353c7a8b91f76153509",
"version": "3.1.6",
Expand Down