[wt] fix HPDF::HPDF link error#49495
Merged
BillyONeal merged 2 commits intomicrosoft:masterfrom Jan 30, 2026
Merged
Conversation
dg0yt
reviewed
Jan 19, 2026
ports/wt/0007-fix-haru.patch
Outdated
Comment on lines
5
to
36
| @@ -275,8 +275,7 @@ find_package(GLEW) | ||
|
|
||
| find_package(Asciidoctor) | ||
|
|
||
| -set(HPDF_ROOT ${HARU_PREFIX}) | ||
| -find_package(HPDF) | ||
| +find_package(unofficial-libharu CONFIG REQUIRED) | ||
|
|
||
| set(OPENSSL_ROOT_DIR ${SSL_PREFIX}) | ||
| find_package(OpenSSL) | ||
| @@ -578,7 +577,7 @@ IF(NOT EXISTS ${CONFIGDIR}/wt_config.xml) | ||
| INSTALL(FILES ${WT_BINARY_DIR}/wt_config.xml DESTINATION ${CONFIGDIR}) | ||
| ENDIF (NOT EXISTS ${CONFIGDIR}/wt_config.xml) | ||
|
|
||
| -if(ENABLE_HARU AND HPDF_FOUND) | ||
| +if(ENABLE_HARU) | ||
| set(HAVE_HARU ON) | ||
| set(WT_HAS_WPDFIMAGE true) | ||
| endif() | ||
| diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
| index 4033d78..939d8aa 100644 | ||
| --- a/src/CMakeLists.txt | ||
| +++ b/src/CMakeLists.txt | ||
| @@ -654,7 +654,7 @@ if(HAVE_HARU) | ||
| # Even though WPdfImage.h exposes <hpdf.h>, we mark it as private here, because most users of Wt don't need it. | ||
| # We don't want to include it in the INTERFACE_LINK_LIBRARIES in the generated wt-target-wt.cmake file, since | ||
| # FindHPDF.cmake is not a standard find module. | ||
| - target_link_libraries(wt PRIVATE HPDF::HPDF) | ||
| + target_link_libraries(wt PRIVATE unofficial::libharu::hpdf) | ||
| else() | ||
| message("** Disabling PDF support (WPdfImage, WPdfRenderer): requires libharu.") | ||
| if(ENABLE_HARU) |
Contributor
There was a problem hiding this comment.
It would prefer to collapse the three chunks to a single:
Suggested change
| @@ -275,8 +275,7 @@ find_package(GLEW) | |
| find_package(Asciidoctor) | |
| -set(HPDF_ROOT ${HARU_PREFIX}) | |
| -find_package(HPDF) | |
| +find_package(unofficial-libharu CONFIG REQUIRED) | |
| set(OPENSSL_ROOT_DIR ${SSL_PREFIX}) | |
| find_package(OpenSSL) | |
| @@ -578,7 +577,7 @@ IF(NOT EXISTS ${CONFIGDIR}/wt_config.xml) | |
| INSTALL(FILES ${WT_BINARY_DIR}/wt_config.xml DESTINATION ${CONFIGDIR}) | |
| ENDIF (NOT EXISTS ${CONFIGDIR}/wt_config.xml) | |
| -if(ENABLE_HARU AND HPDF_FOUND) | |
| +if(ENABLE_HARU) | |
| set(HAVE_HARU ON) | |
| set(WT_HAS_WPDFIMAGE true) | |
| endif() | |
| diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | |
| index 4033d78..939d8aa 100644 | |
| --- a/src/CMakeLists.txt | |
| +++ b/src/CMakeLists.txt | |
| @@ -654,7 +654,7 @@ if(HAVE_HARU) | |
| # Even though WPdfImage.h exposes <hpdf.h>, we mark it as private here, because most users of Wt don't need it. | |
| # We don't want to include it in the INTERFACE_LINK_LIBRARIES in the generated wt-target-wt.cmake file, since | |
| # FindHPDF.cmake is not a standard find module. | |
| - target_link_libraries(wt PRIVATE HPDF::HPDF) | |
| + target_link_libraries(wt PRIVATE unofficial::libharu::hpdf) | |
| else() | |
| message("** Disabling PDF support (WPdfImage, WPdfRenderer): requires libharu.") | |
| if(ENABLE_HARU) | |
| @@ -275,8 +275,8 @@ find_package(GLEW) | |
| find_package(Asciidoctor) | |
| -set(HPDF_ROOT ${HARU_PREFIX}) | |
| -find_package(HPDF) | |
| +find_package(HPDF NAMES unofficial-libharu CONFIG REQUIRED) | |
| +add_library(HPDF::HPDF ALIAS unofficial::libharu::hpdf) | |
| set(OPENSSL_ROOT_DIR ${SSL_PREFIX}) | |
| find_package(OpenSSL) |
Contributor
Author
There was a problem hiding this comment.
@dg0yt
Thanks lot!
It has become very simple and easier to maintain.
dg0yt
reviewed
Jan 19, 2026
| endif() | ||
| - | ||
| +if(@ENABLE_HARU@) | ||
| + find_package(unofficial-libharu QUIET) |
Contributor
There was a problem hiding this comment.
Some day they will use find_dependency() ;-)
vicroms
previously requested changes
Jan 25, 2026
Member
vicroms
left a comment
There was a problem hiding this comment.
Please apply dg0yt's suggestions
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
./vcpkg x-add-version --alland committing the result.I met compilation errors on linking wt.
This PR tries to fix it.