From cb3fd656b285f22e2018910c742413457fa08857 Mon Sep 17 00:00:00 2001 From: fanc999-1 <133952079+fanc999-1@users.noreply.github.com> Date: Fri, 22 May 2026 19:22:05 +0800 Subject: [PATCH] Some CMake updates for Windows builds (#5997) * CMake: Fix building hb-gpu on Windows Add the needed items for the program to build and link on Windows in the CMake build files as well. * CMake: Fix introspection builds with ICU Grab the library name from the results of find_package(ICU COMPONENTS uc) and use it instead for linking HarfBuzz, et al, so that we have a proper command line to link to ICU-UC when running g-ir-scanner. --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71e979877..1ab88ef22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -357,7 +357,8 @@ if (HB_HAVE_ICU) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-icu.h) - list(APPEND THIRD_PARTY_LIBS ICU::uc) + get_target_property(ICU_UC_LIBRARY ICU::uc IMPORTED_LOCATION) + list(APPEND THIRD_PARTY_LIBS ${ICU_UC_LIBRARY}) endif () if (APPLE AND HB_HAVE_CORETEXT) @@ -1060,6 +1061,15 @@ if (HB_BUILD_UTILS) "-framework Metal" "-framework QuartzCore" "-framework Foundation" "-framework AppKit") endif () + if (WIN32) + find_library(D3D11_LIBRARY NAMES d3d11) + find_library(D3DCOMPILER_LIBRARY NAMES d3dcompiler) + target_sources(hb-gpu PRIVATE + ${PROJECT_SOURCE_DIR}/util/gpu/demo-renderer-d3d11.cc) + target_link_libraries(hb-gpu + "${D3D11_LIBRARY}" + "${D3DCOMPILER_LIBRARY}") + endif () endif () endif () endif ()