Skip to content

Commit 788c8ba

Browse files
committed
Static WebView2 (webui-windows-msvc-x64)
1 parent f18a722 commit 788c8ba

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/windows.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ jobs:
3434
include:
3535
- cc: gcc
3636
make: mingw32-make
37+
wv2_static: ''
3738
- cc: msvc
3839
make: nmake
40+
wv2_static: WEBUI_WEBVIEW_STATIC=1
3941
fail-fast: false
4042
env:
4143
ARTIFACT: webui-windows-${{ matrix.cc }}-x64
@@ -51,15 +53,24 @@ jobs:
5153
- uses: microsoft/setup-msbuild@v2
5254
- uses: ilammy/msvc-dev-cmd@v1
5355
if: matrix.cc == 'msvc'
56+
- name: Download WebView2 Static Loader
57+
if: matrix.cc == 'msvc'
58+
shell: pwsh
59+
run: |
60+
Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/" -OutFile "webview2.zip"
61+
Expand-Archive -Path "webview2.zip" -DestinationPath "webview2"
62+
if (Test-Path "webview2/build/native/x64/WebView2LoaderStatic.lib") {
63+
Copy-Item "webview2/build/native/x64/WebView2LoaderStatic.lib" -Destination "WebView2LoaderStatic.lib"
64+
}
5465
- name: Build Debug Target
55-
run: ${{ matrix.make }} debug
66+
run: ${{ matrix.make }} ${{ matrix.wv2_static }} debug
5667
- name: Build Release Target
5768
if: ${{ !cancelled() }}
58-
run: ${{ matrix.make }}
69+
run: ${{ matrix.make }} ${{ matrix.wv2_static }}
5970
- name: Build TLS Debug Target
60-
run: ${{ matrix.make }} WEBUI_USE_TLS=1 debug
71+
run: ${{ matrix.make }} ${{ matrix.wv2_static }} WEBUI_USE_TLS=1 debug
6172
- name: Build TLS Release Target
62-
run: ${{ matrix.make }} WEBUI_USE_TLS=1
73+
run: ${{ matrix.make }} ${{ matrix.wv2_static }} WEBUI_USE_TLS=1
6374
- name: Build examples
6475
run: |
6576
$examples_base_dir = "$(Get-Location)/examples/C/"

0 commit comments

Comments
 (0)