From 20a5779a1bed6be09c044a1d4ecd0af8aca5a6e1 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 4 Nov 2026 12:48:54 -0800 Subject: [PATCH] Expose vcpkg zstd target to LLVM CMake Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- sources/libClangSharp/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sources/libClangSharp/CMakeLists.txt b/sources/libClangSharp/CMakeLists.txt index 3995bdf1..f8158741 100644 --- a/sources/libClangSharp/CMakeLists.txt +++ b/sources/libClangSharp/CMakeLists.txt @@ -46,6 +46,19 @@ if(MSVC) endif() endif() +if(MSVC AND VCPKG_TARGET_TRIPLET) + find_package(zstd CONFIG REQUIRED) + + if(NOT TARGET zstd::libzstd) + message(FATAL_ERROR "The vcpkg zstd package did not define zstd::libzstd") + endif() + + if(NOT TARGET zstd::libzstd_static) + add_library(zstd::libzstd_static INTERFACE IMPORTED) + set_property(TARGET zstd::libzstd_static PROPERTY INTERFACE_LINK_LIBRARIES zstd::libzstd) + endif() +endif() + find_package(Clang REQUIRED CONFIG PATHS ${LLVM_SEARCH_PATHS} NO_DEFAULT_PATH)