[llvm] 62d0aff - [cmake] Extend zstd.dll finding logic from MSVC to Clang (#121437)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 07:43:49 PST 2025


Author: Michał Górny
Date: 2025-01-02T15:43:45Z
New Revision: 62d0aff3eb934439acac47348e2385f0751a1444

URL: https://github.com/llvm/llvm-project/commit/62d0aff3eb934439acac47348e2385f0751a1444
DIFF: https://github.com/llvm/llvm-project/commit/62d0aff3eb934439acac47348e2385f0751a1444.diff

LOG: [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

Added: 
    

Modified: 
    llvm/cmake/modules/Findzstd.cmake

Removed: 
    


################################################################################
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)


        


More information about the llvm-commits mailing list