Merge pull request #10253 from akallabeth/webview2-arch-detect

[client,sdl] fix architecture paths for WebView2
This commit is contained in:
akallabeth 2024-06-05 15:19:58 +02:00 committed by GitHub
commit 90b4e54d7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@ on:
permissions:
pull-requests: write
issues: write
repository: read
jobs:
build:

View File

@ -37,6 +37,13 @@ endif()
function(target_link_webview2 target)
if(WIN32)
if (CMAKE_CXX_COMPILER_ARCHITECTURE_ID)
set(ARCH ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID})
elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID)
set(ARCH ${CMAKE_C_COMPILER_ARCHITECTURE_ID})
else()
message(FATAL_ERROR "Unknown CMAKE_<lang>_COMPILER_ARCHITECTURE_ID")
endif()
target_include_directories(${target}
PRIVATE
"${WEBVIEW2_PACKAGE_DIR}/build/native/include"
@ -45,7 +52,7 @@ function(target_link_webview2 target)
PRIVATE
shlwapi
version
"${WEBVIEW2_PACKAGE_DIR}/build/native/${CMAKE_VS_PLATFORM_NAME}/WebView2LoaderStatic.lib"
"${WEBVIEW2_PACKAGE_DIR}/build/native/${ARCH}/WebView2LoaderStatic.lib"
)
endif()
endfunction()