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] Fix wx-config --libs output #18580

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
46 changes: 46 additions & 0 deletions ports/wxwidgets/fix-wxconfig-libs-output.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index 91d11ac..4e22ee9 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -41,7 +41,40 @@ macro(wx_get_dependencies var lib)
endif()
set(dep_name "-l${dep_name}")
else()
- get_filename_component(dep_name ${dep} NAME)
+ if (CMAKE_BUILD_TYPE STREQUAL "Release")
+ # For "$<$<CONFIG:DEBUG>:"
+ set(CONFIG_TYPE_INVERT "CONFIG:DEBUG>:")
+ else()
+ # For "$<$<NOT:$<CONFIG:DEBUG>>:"
+ set(CONFIG_TYPE_INVERT "CONFIG:DEBUG>>:")
+ endif()
+ if (dep MATCHES "${CONFIG_TYPE_INVERT}")
+ continue()
+ endif()
+ string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_path ${dep})
+ if (NOT dep_path)
+ set(dep_name ${dep})
+ else()
+ string(REGEX MATCH "^-.*$" ADDED_PREFIX ${dep_path})
+ if (ADDED_PREFIX)
+ set(dep_name ${dep_path})
+ else()
+ get_filename_component(abs_path ${dep_path} PATH)
+ if (NOT abs_path)
+ string(REGEX MATCH "^lib(.*).a$" CURR_STATIC_NAME ${dep_path})
+ string(REGEX MATCH "^lib(.*).so$" CURR_DYNAMIC_NAME ${dep_path})
+ if (CURR_STATIC_NAME)
+ set(dep_name "-l${CURR_STATIC_NAME}")
+ elseif (CURR_DYNAMIC_NAME)
+ set(dep_name "-l${CURR_DYNAMIC_NAME}")
+ else()
+ set(dep_name "-l${dep_path}")
+ endif()
+ else()
+ set(dep_name ${dep_path})
+ endif()
+ endif()
+ endif()
endif()
wx_string_append(${var} "${dep_name} ")
endforeach()
1 change: 1 addition & 0 deletions ports/wxwidgets/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
PATCHES
disable-platform-lib-dir.patch
fix-build.patch
fix-wxconfig-libs-output.patch
)

set(OPTIONS)
Expand Down
2 changes: 1 addition & 1 deletion ports/wxwidgets/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wxwidgets",
"version-semver": "3.1.5",
"port-version": 2,
"port-version": 3,
"description": "a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications.",
"homepage": "https://github.com/wxWidgets/wxWidgets",
"supports": "!uwp",
Expand Down