Conversation
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds a custom vcpkg port overlay for the Microsoft WebView2 loader, targeting an updated WebView2 NuGet package version.
Changes:
- Introduces a
webview2port manifest pinned to1.0.3800.47 - Adds a CMake package config to expose an imported target (
unofficial::webview2::webview2) - Implements the portfile to download/extract the NuGet payload and install headers/binaries
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| 3rdParty/vcpkg_ports/ports/webview2/vcpkg.json | Defines the webview2 port metadata and dependency on wil. |
| 3rdParty/vcpkg_ports/ports/webview2/unofficial-webview2-config.cmake | Provides an imported CMake target for consumers via find_package. |
| 3rdParty/vcpkg_ports/ports/webview2/portfile.cmake | Downloads the NuGet package and installs headers/libs/dlls into the vcpkg package layout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if(NOT TARGET unofficial::webview2::webview2) | ||
| if(EXISTS "${_IMPORT_PREFIX}/lib/WebView2LoaderStatic.lib") | ||
| add_library(unofficial::webview2::webview2 STATIC IMPORTED) | ||
| set_target_properties(unofficial::webview2::webview2 | ||
| PROPERTIES | ||
| INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" | ||
| IMPORTED_LOCATION "${_IMPORT_PREFIX}/lib/WebView2LoaderStatic.lib") | ||
| else() | ||
| add_library(unofficial::webview2::webview2 SHARED IMPORTED) | ||
| set_target_properties(unofficial::webview2::webview2 | ||
| PROPERTIES | ||
| INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" | ||
| IMPORTED_LOCATION "${_IMPORT_PREFIX}/bin/WebView2Loader.dll" | ||
| IMPORTED_IMPLIB "${_IMPORT_PREFIX}/lib/WebView2Loader.dll.lib") | ||
| endif() | ||
| endif() |
There was a problem hiding this comment.
The port declares a dependency on wil in vcpkg.json, but the generated CMake package does not call find_dependency(wil) nor link the dependency on the exported target. This can break consumers that rely on find_package(unofficial-webview2 CONFIG) to transitively provide required include dirs/compile definitions from wil. Consider using include(CMakeFindDependencyMacro) + find_dependency(wil CONFIG REQUIRED) and adding the appropriate WIL target to INTERFACE_LINK_LIBRARIES of unofficial::webview2::webview2.
| DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-webview2") | ||
|
|
||
| # The import libraries for webview fail with "Could not find proper second linker member" | ||
| set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
There was a problem hiding this comment.
VCPKG_POLICY_EMPTY_PACKAGE is intended to allow truly empty packages to pass vcpkg validation. This port installs headers and libraries/dlls, so enabling this policy is misleading and may hide packaging problems rather than addressing them. Prefer removing this policy and fixing the underlying import-library validation issue (or, if the intent is to ship headers only, stop installing libs/dlls and keep the policy with a clearer rationale).
| set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
| "homepage": "https://docs.microsoft.com/en-us/microsoft-edge/webview2", | ||
| "documentation": "https://docs.microsoft.com/en-us/microsoft-edge/webview2", |
There was a problem hiding this comment.
docs.microsoft.com has been superseded by learn.microsoft.com for Microsoft documentation. Consider updating these URLs to the current Learn domain to avoid redirects and keep metadata current.
| "homepage": "https://docs.microsoft.com/en-us/microsoft-edge/webview2", | |
| "documentation": "https://docs.microsoft.com/en-us/microsoft-edge/webview2", | |
| "homepage": "https://learn.microsoft.com/en-us/microsoft-edge/webview2", | |
| "documentation": "https://learn.microsoft.com/en-us/microsoft-edge/webview2", |
Summary by cubic
Adds a custom vcpkg port for Microsoft WebView2 (1.0.3800.47) to make WebView2 available in our Windows builds via vcpkg. Includes an unofficial CMake config that provides a single imported target for static or shared linking.
Written for commit 0a6a5d8. Summary will update on new commits.