vcpkg/ports/wxwidgets/fix-libs-export.patch
Kai Pastor 48d15f4db6
[wxwidgets] Validate and fix (#24047)
* Add wxwidgets example and test port

* Fix library processing for export

Split original patch.
Restore missing appending in the end.
Drop libs (generator expression) which don't match build type.

* Make wx-config relocatable

* Rewrite wrapper

* Add missing libjpeg-turbo dependency

* Fixup wxrc

* Update usage

* Validate release/debug consistency

* Fixup wx-config symlink

* Use non-deprecated license expression

* Fix portfile quirks

* Transform installation fixup into patch

* Fix mingw

* Control curl dependency

* Add message for linux system package dependencies

* Update versions

* Resolve linux lib issues

* Update versions

* Minor amendments

* Update versions

* Update requirements warning

* Update versions

* CR request: Move CMakelists.txt to example dir

* CR requests: Revise wrapper

* Update versions
2022-04-18 10:56:00 -07:00

37 lines
1.6 KiB
Diff

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()