From 4725466801390d47c8d987dbd6d4671e02ab85a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 2 Jan 2025 15:43:45 +0000 Subject: [PATCH] [cmake] Extend zstd.dll finding logic from MSVC to Clang (#121437) Extend the special logic for finding `zstd.dll` in `Findzstd` to apply to all MSVC-compatible configurations such as Clang targeting MSVC. Fixes #121345 (cherry picked from commit 62d0aff3eb934439acac47348e2385f0751a1444) --- llvm/cmake/modules/Findzstd.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/cmake/modules/Findzstd.cmake b/llvm/cmake/modules/Findzstd.cmake index 86b6d48b6ec6b6..f6ca5d1ebe546b 100644 --- a/llvm/cmake/modules/Findzstd.cmake +++ b/llvm/cmake/modules/Findzstd.cmake @@ -10,7 +10,7 @@ # zstd::libzstd_shared # zstd::libzstd_static -if(MSVC) +if(MSVC OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") set(zstd_STATIC_LIBRARY_SUFFIX "_static\\${CMAKE_STATIC_LIBRARY_SUFFIX}$") else() set(zstd_STATIC_LIBRARY_SUFFIX "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$") @@ -33,7 +33,7 @@ if(zstd_FOUND) set(zstd_STATIC_LIBRARY "${zstd_LIBRARY}") elseif (NOT TARGET zstd::libzstd_shared) add_library(zstd::libzstd_shared SHARED IMPORTED) - if(MSVC) + if(MSVC OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") include(GNUInstallDirs) # For CMAKE_INSTALL_LIBDIR and friends. # IMPORTED_LOCATION is the path to the DLL and IMPORTED_IMPLIB is the "library". get_filename_component(zstd_DIRNAME "${zstd_LIBRARY}" DIRECTORY)