From 486e69e23b3359d87369bf7c4fd87433458ae675 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 30 Oct 2017 14:41:37 -0400 Subject: [PATCH] Windows: Add missing swiftshader binaries to distribution (issue #2291) --- cmake/cef_macros.cmake.in | 14 +++++++++- cmake/cef_variables.cmake.in | 1 + tools/distrib/win/README.redistrib.txt | 6 ++++ tools/make_distrib.py | 38 ++++++++++++++++---------- 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/cmake/cef_macros.cmake.in b/cmake/cef_macros.cmake.in index b2c33cf07..fe58ee19a 100644 --- a/cmake/cef_macros.cmake.in +++ b/cmake/cef_macros.cmake.in @@ -101,7 +101,19 @@ macro(COPY_FILES target file_list source_dir target_dir) set(source_file ${source_dir}/${FILENAME}) get_filename_component(target_name ${FILENAME} NAME) set(target_file ${target_dir}/${target_name}) - if(IS_DIRECTORY ${source_file}) + + string(FIND ${source_file} "$" pos) + if(pos GREATER_EQUAL 0) + # Must test with an actual configuration directory. + string(REPLACE "$" "Release" existing_source_file ${source_file}) + if(NOT EXISTS ${existing_source_file}) + string(REPLACE "$" "Debug" existing_source_file ${source_file}) + endif() + else() + set(existing_source_file ${source_file}) + endif() + + if(IS_DIRECTORY ${existing_source_file}) add_custom_command( TARGET ${target} POST_BUILD diff --git a/cmake/cef_variables.cmake.in b/cmake/cef_variables.cmake.in index cc49b69e7..98cca6593 100644 --- a/cmake/cef_variables.cmake.in +++ b/cmake/cef_variables.cmake.in @@ -415,6 +415,7 @@ if(OS_WINDOWS) libGLESv2.dll natives_blob.bin snapshot_blob.bin + swiftshader ) # List of CEF resource files. diff --git a/tools/distrib/win/README.redistrib.txt b/tools/distrib/win/README.redistrib.txt index f2a1e91f4..5a8c7ac37 100644 --- a/tools/distrib/win/README.redistrib.txt +++ b/tools/distrib/win/README.redistrib.txt @@ -67,6 +67,12 @@ run but any related functionality may become broken or disabled. Without these files HTML5 accelerated content like 2D canvas, 3D CSS and WebGL will not function. +* SwiftShader support. + * swiftshader/libEGL.dll + * swiftshader/libGLESv2.dll + Without these files WebGL will not function in software-only mode when the GPU + is not available or disabled. + * Widevine CDM support. * widevinecdmadapter.dll Without this file playback of Widevine projected content will not function. diff --git a/tools/make_distrib.py b/tools/make_distrib.py index e2f67703b..99dbd4a2b 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -654,17 +654,19 @@ if mode == 'standard': if platform == 'windows': binaries = [ - 'chrome_elf.dll', - 'd3dcompiler_47.dll', - 'libcef.dll', - 'libEGL.dll', - 'libGLESv2.dll', - 'natives_blob.bin', - 'snapshot_blob.bin', - 'v8_context_snapshot.bin', + {'path': 'chrome_elf.dll'}, + {'path': 'd3dcompiler_47.dll'}, + {'path': 'libcef.dll'}, + {'path': 'libEGL.dll'}, + {'path': 'libGLESv2.dll'}, + {'path': 'natives_blob.bin'}, + {'path': 'snapshot_blob.bin'}, + {'path': 'v8_context_snapshot.bin'}, # Should match the output path from media/cdm/ppapi/cdm_paths.gni. - 'WidevineCdm\\_platform_specific\\win_%s\\widevinecdmadapter.dll' % \ - ('x64' if options.x64build else 'x86'), + {'path': 'WidevineCdm\\_platform_specific\\win_%s\\widevinecdmadapter.dll' % \ + ('x64' if options.x64build else 'x86'), 'strip_folder': True}, + {'path': 'swiftshader\\libEGL.dll'}, + {'path': 'swiftshader\\libGLESv2.dll'}, ] libcef_dll_file = 'libcef.dll.lib' @@ -707,9 +709,13 @@ if platform == 'windows': copy_files( os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet) for binary in binaries: + if 'strip_folder' in binary and binary['strip_folder']: + target_path = os.path.join(dst_dir, os.path.basename(binary['path'])) + else: + target_path = os.path.join(dst_dir, binary['path']) + make_dir(os.path.dirname(target_path), options.quiet) copy_file( - os.path.join(build_dir, binary), - os.path.join(dst_dir, os.path.basename(binary)), options.quiet) + os.path.join(build_dir, binary['path']), target_path, options.quiet) copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \ options.quiet) @@ -735,9 +741,13 @@ if platform == 'windows': copy_files( os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet) for binary in binaries: + if 'strip_folder' in binary and binary['strip_folder']: + target_path = os.path.join(dst_dir, os.path.basename(binary['path'])) + else: + target_path = os.path.join(dst_dir, binary['path']) + make_dir(os.path.dirname(target_path), options.quiet) copy_file( - os.path.join(build_dir, binary), - os.path.join(dst_dir, os.path.basename(binary)), options.quiet) + os.path.join(build_dir, binary['path']), target_path, options.quiet) if mode != 'client': copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \