[freetype] Fix INTERFACE_LINK_LIBRARIES in exported cmake file#14499
[freetype] Fix INTERFACE_LINK_LIBRARIES in exported cmake file#14499strega-nil merged 4 commits intomicrosoft:masterfrom
Conversation
| set(PKG_CONFIG_REQUIRED_PRIVATE "") | ||
|
|
||
| if (ZLIB_FOUND) | ||
| - target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES}) |
There was a problem hiding this comment.
${ZLIB_LIBRARIES} is correct, but it's value is not optimized;...;debug;..., so different values are generated in INTERFACE_LINK_LIBRARIES in freetype-config.cmake, and vcpkg_fixup_cmake_targets deletes the debug freetype-config.cmake, which causes this problem.
We should avoid using the macros provided by cmake's module.
That means ZLIB requires a wrapper to correctly set that value on Linux. You are just dropping a droplet of water on a hot stone with that patch. You might have fixed freetype but all other ports using ZLIB_LIBRARIES still have the same problem. The root cause ist that ZLIB_LIBRARIES is not correctly set with debug/optimized keywords and needs fixing on Linux/OSX.
There was a problem hiding this comment.
${ZLIB_LIBRARIES} is correct, but it's value is not optimized;...;debug;..., so different values are generated in INTERFACE_LINK_LIBRARIES in freetype-config.cmake, and vcpkg_fixup_cmake_targets deletes the debug freetype-config.cmake, which causes this problem.
We should avoid using the macros provided by cmake's module.That means ZLIB requires a wrapper to correctly set that value on Linux. You are just dropping a droplet of water on a hot stone with that patch. You might have fixed freetype but all other ports using
ZLIB_LIBRARIESstill have the same problem. The root cause ist thatZLIB_LIBRARIESis not correctly set with debug/optimized keywords and needs fixing on Linux/OSX.
This means that all module modes(Find*.cmake) that call cmake by default have a high probability of this problem. So I think we should deal with it uniformly (by vcpkg, not by port).
|
Merged as "makes the experience better, but it'd be great to fix the underlying issues" |
|
In order to prevent this from happening, we at least need to find in POST_CHECK whether there is a release version of the library in |
Fix wrong INTERFACE_LINK_LIBRARIES in freetype-config.cmake:
Fixes #9952.