summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-08-17 17:32:08 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-12 17:50:22 +0000
commit9eaf5a5c9fa46991f40d57a04e6a16871581c733 (patch)
tree4bd1aaa8cc6b39b332d4f45d01db4c2fddd58a8c
parent3a506b859f699f2ee461e84c41bcd9c031fe76a8 (diff)
Use delay load for media foundation
We should delay some dll loads as MediaFoundation is not available on Windows N. Chromium already uses that option when compiling components, however we use only response file to track dependencies, and those libs were never linked with DELAYLAD flags by (qt)cmake. There is currently no nice way to set those base on gn dependencies as those are generated on bulid time and we need linker flags on configure time. As workaround simply hardcode those 3 required libs, as side effect when linking QtPdf module there will be warning that there are no references to mentioned media foundation libs. Fixes: QTBUG-100391 Change-Id: I06e4bffdf8bc6803a4f2b1437679628b9a733299 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io> (cherry picked from commit 74163a6511278fa8273ca931ffdf9b9b3a8daae6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--cmake/Functions.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 6d4506a45..cf921dce8 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -456,6 +456,7 @@ function(add_linker_options target buildDir completeStatic)
endif()
if(WIN32)
get_copy_of_response_file(objects_rsp ${target} objects)
+ target_link_options(${cmakeTarget} PRIVATE /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll /DELAYLOAD:mfreadwrite.dll)
target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${objects_rsp}>")
if(NOT completeStatic)
get_copy_of_response_file(archives_rsp ${target} archives)