Fix of Webview2 deps.

Added checking existence of target (Mac + Linux).
Force webview2 to be appended to build list (Win).
This commit is contained in:
David Kocik 2024-02-05 13:40:43 +01:00
parent 218a24c7cf
commit b032bf792b

13
deps/CMakeLists.txt vendored
View File

@ -140,11 +140,6 @@ if (UNIX)
endif ()
endif ()
if (MSVC)
list(APPEND REQUIRED_PACKAGES WebView2)
endif()
list(APPEND SYSTEM_PROVIDED_PACKAGES ${${PROJECT_NAME}_PLATFORM_PACKAGES})
list(REMOVE_DUPLICATES SYSTEM_PROVIDED_PACKAGES)
@ -185,7 +180,7 @@ foreach (pkg ${FOUND_PACKAGES})
if (${pkg} IN_LIST SYSTEM_PROVIDED_PACKAGES)
check_system_package(${pkg} _checked_list)
else ()
elseif (TARGET dep_${pkg})
get_target_property(_is_excluded_from_all dep_${pkg} EXCLUDE_FROM_ALL)
if (NOT _is_excluded_from_all)
list(APPEND DEPS_TO_BUILD ${pkg})
@ -194,6 +189,12 @@ foreach (pkg ${FOUND_PACKAGES})
endif ()
endforeach()
# This ugly append ensures that WebView2 was appended no matter what EXCLUDE_FROM_ALL is.
# (Webview2 is not added by add_cmake_project)
if (MSVC)
list(APPEND DEPS_TO_BUILD WebView2)
endif()
# Establish dependency graph
foreach (pkg ${SUPPORTED_PACKAGES})
if (${pkg} IN_LIST DEPS_TO_BUILD)