2024-04-12 13:39:43 +00:00
|
|
|
project('webview2', 'c', version : '1.0.2420.47')
|
2023-05-14 19:56:32 +00:00
|
|
|
|
|
|
|
py3 = import('python3').find_python()
|
|
|
|
|
|
|
|
if host_machine.system() != 'windows'
|
|
|
|
error('Can only download webview2 for Windows')
|
|
|
|
endif
|
|
|
|
|
|
|
|
message('Downloading and extracting webview2 nuget package')
|
|
|
|
|
|
|
|
arch = target_machine.cpu_family()
|
2024-04-12 13:39:43 +00:00
|
|
|
if arch not in ['x86_64', 'x86', 'aarch64']
|
|
|
|
error(f'Unexpected architecture @arch@')
|
2023-05-14 19:56:32 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
zip_hash = '8e5a7307d71507edbbe02cac27215d71058bbd82cd256cef60f06b945907610a'
|
|
|
|
version = meson.project_version()
|
2024-04-12 13:39:43 +00:00
|
|
|
ret = run_command(py3, files('download-binary.py'), version, zip_hash,
|
2023-05-14 19:56:32 +00:00
|
|
|
check: true)
|
|
|
|
|
2024-04-12 13:39:43 +00:00
|
|
|
base_path = f'webview2-@version@' / 'build' / 'native'
|
|
|
|
inc_dir = include_directories(base_path / 'include')
|
|
|
|
lib_base_path = meson.current_source_dir() / base_path
|
2023-05-14 19:56:32 +00:00
|
|
|
lib_path = ''
|
|
|
|
if arch == 'x86_64'
|
2024-04-12 13:39:43 +00:00
|
|
|
lib_path = lib_base_path / 'x64'
|
2023-05-14 19:56:32 +00:00
|
|
|
elif arch == 'x86'
|
2024-04-12 13:39:43 +00:00
|
|
|
lib_path = lib_base_path / 'x86'
|
2023-05-14 19:56:32 +00:00
|
|
|
else
|
2024-04-12 13:39:43 +00:00
|
|
|
lib_path = lib_base_path / 'arm64'
|
2023-05-14 19:56:32 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
2024-04-12 13:39:43 +00:00
|
|
|
loader_static = cc.find_library('WebView2LoaderStatic', dirs: lib_path)
|
2023-05-14 19:56:32 +00:00
|
|
|
webview2_dep = declare_dependency(include_directories: inc_dir,
|
|
|
|
dependencies: loader_static)
|