From c718d6bad80c789c05429eeea9d7b1379c520bc8 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Fri, 17 Jul 2026 21:29:59 -0400 Subject: [PATCH] [Fix] (MG_Test/Backend/DirectVulkan): link the whole MobileGL_s archive on MSVC so dllimport-declared gl*/egl* references resolve against the in-library entry points --- MobileGL/MG_Test/Backend/DirectVulkan/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MobileGL/MG_Test/Backend/DirectVulkan/CMakeLists.txt b/MobileGL/MG_Test/Backend/DirectVulkan/CMakeLists.txt index 0dd6ab9a..f375d54b 100644 --- a/MobileGL/MG_Test/Backend/DirectVulkan/CMakeLists.txt +++ b/MobileGL/MG_Test/Backend/DirectVulkan/CMakeLists.txt @@ -40,6 +40,12 @@ if (APPLE) target_link_libraries(DirectVulkanSanityTest PRIVATE objc) target_link_libraries(DirectVulkanSanityTest PRIVATE ${QUARTZCORE_FRAMEWORK}) endif() +if (MSVC) + # The GLES headers declare gl* as dllimport on Windows, so objects like GetProcAddress.cpp + # reference __imp_gl*. Those resolve against the in-library GL entry-point definitions only + # if their objects are part of the link; pull the whole static library like the DLL does. + target_link_options(DirectVulkanSanityTest PRIVATE /WHOLEARCHIVE:MobileGL_s) +endif() target_compile_definitions(DirectVulkanSanityTest PRIVATE -DNOMINMAX) include(GoogleTest)