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-13 11:56:52 +0000
commita1e2be558b2833459aff0e98343add724fe885e5 (patch)
treea0fb75112ff15d0cb71dd75d503f50c532aaba93
parente0c0f791a10d73b53c4790a20b41f254331903c0 (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)