-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[wxwidgets] Validate and fix #24047
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
Merged
Merged
[wxwidgets] Validate and fix #24047
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
97430f9
Add wxwidgets example and test port
dg0yt 63a5cd7
Fix library processing for export
dg0yt 040809a
Make wx-config relocatable
dg0yt 5f84aa3
Rewrite wrapper
dg0yt f809593
Add missing libjpeg-turbo dependency
dg0yt 0b35857
Fixup wxrc
dg0yt 4d43b8c
Update usage
dg0yt 39375c2
Validate release/debug consistency
dg0yt d63c4ca
Fixup wx-config symlink
dg0yt 98d1df5
Use non-deprecated license expression
dg0yt 8380bbd
Fix portfile quirks
dg0yt 20aba40
Transform installation fixup into patch
dg0yt 12912f1
Fix mingw
dg0yt 1a052e2
Control curl dependency
dg0yt 0f070a1
Add message for linux system package dependencies
dg0yt b3d6ab0
Update versions
dg0yt 99c36d8
Merge remote-tracking branch 'origin/master' into wxwidgets
dg0yt 5b0c87e
Resolve linux lib issues
dg0yt 1b54949
Update versions
dg0yt e26d7f1
Minor amendments
dg0yt a7c2c07
Update versions
dg0yt 63901a9
Update requirements warning
dg0yt 8c4b877
Update versions
dg0yt f12bb57
Merge master into wxwidgets
dg0yt 16cc13b
CR request: Move CMakelists.txt to example dir
dg0yt 78307e5
CR requests: Revise wrapper
dg0yt a4ad20c
Update versions
dg0yt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| cmake_minimum_required(VERSION 3.7) | ||
|
|
||
| project(wxwidgets-example) | ||
|
|
||
| add_executable(main WIN32 popup.cpp) | ||
|
|
||
| find_package(wxWidgets REQUIRED) | ||
| target_compile_definitions(main PRIVATE ${wxWidgets_DEFINITIONS} "$<$<CONFIG:DEBUG>:${wxWidgets_DEFINITIONS_DEBUG}>") | ||
| target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS}) | ||
| target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES}) | ||
|
|
||
| option(USE_WXRC "Use the wxrc resource compiler" ON) | ||
| if(USE_WXRC) | ||
| execute_process( | ||
| COMMAND "${wxWidgets_wxrc_EXECUTABLE}" --help | ||
| RESULTS_VARIABLE error_result | ||
| ) | ||
| if(error_result) | ||
| message(FATAL_ERROR "Failed to run wxWidgets_wxrc_EXECUTABLE (${wxWidgets_wxrc_EXECUTABLE})") | ||
| endif() | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake | ||
| index 91d11ac..2791466 100644 | ||
| --- a/build/cmake/config.cmake | ||
| +++ b/build/cmake/config.cmake | ||
| @@ -41,7 +41,30 @@ macro(wx_get_dependencies var lib) | ||
| endif() | ||
| set(dep_name "-l${dep_name}") | ||
| else() | ||
| - get_filename_component(dep_name ${dep} NAME) | ||
| + # For the value like $<$<CONFIG:DEBUG>:LIB_PATH> | ||
| + # Or $<$<NOT:$<CONFIG:DEBUG>>:LIB_PATH> | ||
| + if(dep MATCHES "^(.+>):(.+)>$") | ||
| + if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_MATCH_1 STREQUAL [[$<$<NOT:$<CONFIG:DEBUG>>]]) | ||
| + continue() | ||
| + elseif(CMAKE_BUILD_TYPE STREQUAL "Release" AND CMAKE_MATCH_1 STREQUAL [[$<$<CONFIG:DEBUG>]]) | ||
| + continue() | ||
| + endif() | ||
| + set(dep_name "${CMAKE_MATCH_2}") | ||
| + else() | ||
| + set(dep_name ${dep}) | ||
| + endif() | ||
| + endif() | ||
| + if(dep_name STREQUAL "libc.so") | ||
| + continue() # don't include this library | ||
| + elseif(dep_name MATCHES "^-") # -l, -framework, -weak_framework | ||
| + # ok | ||
| + elseif(dep_name MATCHES "^lib(.*)(.so|.dylib|.tbd|.a)$") | ||
| + set(dep_name "-l${CMAKE_MATCH_1} ") | ||
| + elseif(dep_name) | ||
| + get_filename_component(abs_path ${dep_name} PATH) | ||
| + if (NOT abs_path) | ||
| + set(dep_name "-l${dep_name} ") | ||
| + endif() | ||
| endif() | ||
| wx_string_append(${var} "${dep_name} ") | ||
| endforeach() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake | ||
| index 902b7c5..dba3d07 100644 | ||
| --- a/build/cmake/functions.cmake | ||
| +++ b/build/cmake/functions.cmake | ||
| @@ -374,7 +374,7 @@ macro(wx_add_library name) | ||
| wx_install(TARGETS ${name} | ||
| LIBRARY DESTINATION "lib${wxPLATFORM_LIB_DIR}" | ||
| ARCHIVE DESTINATION "lib${wxPLATFORM_LIB_DIR}" | ||
| - RUNTIME DESTINATION "lib${wxPLATFORM_LIB_DIR}" | ||
| + RUNTIME DESTINATION "bin" | ||
| BUNDLE DESTINATION Applications/wxWidgets | ||
| ) | ||
| endif() | ||
| diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake | ||
| index 0bc4f93..65fe3b8 100644 | ||
| --- a/build/cmake/init.cmake | ||
| +++ b/build/cmake/init.cmake | ||
| @@ -149,7 +149,7 @@ else() | ||
| set(wxCOMPILER_PREFIX) | ||
| endif() | ||
|
|
||
| -if(MSVC) | ||
| +if(MSVC AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR) | ||
| if(wxBUILD_SHARED) | ||
| set(lib_suffix "dll") | ||
| else() | ||
| diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake | ||
| index 968dff8..5b4fda9 100644 | ||
| --- a/build/cmake/install.cmake | ||
| +++ b/build/cmake/install.cmake | ||
| @@ -45,7 +45,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 4108d6a..19d730e 100644 | ||
| --- a/build/cmake/utils/CMakeLists.txt | ||
| +++ b/build/cmake/utils/CMakeLists.txt | ||
| @@ -39,7 +39,7 @@ if(wxUSE_XRC) | ||
| )" | ||
| ) | ||
| install(CODE "execute_process( \ | ||
| - COMMAND ${CMAKE_COMMAND} -E create_symlink \ | ||
| + COMMAND ${CMAKE_COMMAND} -E copy \ | ||
| ${CMAKE_INSTALL_PREFIX}/bin/wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \ | ||
| ${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \ | ||
| )" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| 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}" | ||
JackBoosY marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| diff --git a/wx-config.in b/wx-config.in | ||
| index 441f88c..b326867 100755 | ||
| --- a/wx-config.in | ||
| +++ b/wx-config.in | ||
| @@ -91,7 +91,7 @@ EOF | ||
|
|
||
|
|
||
| # Contentious tools determined by configure. | ||
| -EGREP="@EGREP@" | ||
| +EGREP="grep -E" # no absolute path from host | ||
|
|
||
|
|
||
| # For the people who know what they want, or think they do: | ||
| @@ -402,8 +402,23 @@ is_cross() { [ "x@cross_compiling@" = "xyes" ]; } | ||
|
|
||
|
|
||
| # Determine the base directories we require. | ||
| -prefix=${input_option_prefix-${this_prefix:-@prefix@}} | ||
| -exec_prefix=${input_option_exec_prefix-${input_option_prefix-${this_exec_prefix:-@exec_prefix@}}} | ||
| +vcpkg_prefix=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) | ||
| +case "$vcpkg_prefix" in | ||
| + */lib/wx/config) | ||
| + vcpkg_prefix=${vcpkg_prefix%/*/*/*} | ||
| + ;; | ||
| + */tools/wxwidgets/debug) | ||
| + vcpkg_prefix=${vcpkg_prefix%/*/*/*}/debug | ||
| + ;; | ||
| + */tools/wxwidgets) | ||
dg0yt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| + vcpkg_prefix=${vcpkg_prefix%/*/*} | ||
| + ;; | ||
| +esac | ||
| +if [ -n "@MINGW@" -a -n "@CMAKE_HOST_WIN32@" ]; then | ||
| + vcpkg_prefix=$(cygpath -m "$vcpkg_prefix") | ||
| +fi | ||
| +prefix=${input_option_prefix-${this_prefix:-$vcpkg_prefix}} | ||
| +exec_prefix=${input_option_exec_prefix-${input_option_prefix-${this_exec_prefix:-$prefix}}} | ||
| wxconfdir="@libdir@/wx/config" | ||
|
|
||
| installed_configs=`cd "$wxconfdir" 2> /dev/null && ls | grep -v "^inplace-"` | ||
| @@ -940,6 +949,9 @@ prefix=${this_prefix-$prefix} | ||
| exec_prefix=${this_exec_prefix-$exec_prefix} | ||
|
|
||
| includedir="@includedir@" | ||
| +if [ "@CMAKE_BUILD_TYPE@" = "Debug" ] ; then | ||
| + includedir="${includedir%/debug/include}/include" | ||
| +fi | ||
| libdir="@libdir@" | ||
| bindir="@bindir@" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| The package wxwidgets provides CMake integration: | ||
|
|
||
| find_package(wxWidgets REQUIRED) | ||
| target_compile_definitions(main PRIVATE ${wxWidgets_DEFINITIONS} "$<$<CONFIG:DEBUG>:${wxWidgets_DEFINITIONS_DEBUG}>") | ||
| target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS}) | ||
| target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might make it an error if there is something else than
NOT,CONFIG:DEBUG,LINK_ONLY, to catch future changes.