get_prerequisites: add an option to not fail on missing delay load dependencies
Some libraries use the delay load mechanism to provide extra functionalities by loading other libraries only when first used. If such a functionality is never used, then the library implementing it will never be loaded.
This means the application can actually be run without the need of those extra libraries as long as the features using them are not used.
Hence, it would be nice to have an option in get_prerequisites
(and fixup_bundle
) to just warn when such a delay load dependency is missing instead of always sending an error.
A concrete example: On my Windows 7 install, the Qt5WebEngineCored.dll
library depends on BluetoothApis.dll
which I don't have (it does not even seem to be available for Windows 7). My application is not using bluetooth at all so I'm fine. However, I am not able to generate a bundle with CMake because of the missing lib.
Output of dumpbin
for Qt5WebEngineCored.dll
:
File Type: DLL
Image has the following dependencies:
KERNEL32.dll
Qt5Quickd.dll
Qt5Guid.dll
Qt5WebChanneld.dll
Qt5Networkd.dll
Qt5Cored.dll
COMCTL32.dll
Secur32.dll
CRYPT32.dll
IPHLPAPI.DLL
IMM32.dll
MSVCP120D.dll
MSVCR120D.dll
RPCRT4.dll
WINHTTP.dll
dhcpcsvc.DLL
USERENV.dll
WS2_32.dll
USP10.dll
PSAPI.DLL
WINMM.dll
SHLWAPI.dll
ADVAPI32.dll
GDI32.dll
COMDLG32.dll
ole32.dll
OLEAUT32.dll
VERSION.dll
Image has the following delay load dependencies:
USER32.dll
dwmapi.dll
d3d9.dll
d3d11.dll
dxva2.dll
MF.dll
MFPlat.DLL
bthprops.cpl
BluetoothApis.dll
dbghelp.dll
CFGMGR32.dll
POWRPROF.dll
SETUPAPI.dll
SHELL32.dll
MFReadWrite.dll
Summary
1F9000 .data
10F51000 .rdata
2BE000 .reloc
2000 .rodata
1000 .rsrc
4A2D000 .text
1000 .tls
1000 _RDATA
I somewhat worked around the problem for now by overriding gp_resolved_file_type_override
to return system
for BluetoothApis.dll
, but this requires to not bundle system libraries, to implement such a work-around for each possible delay load dependencies and it still generates warning messages saying the full path of the lib cannot be found.