Skip to content

Commit 003686f

Browse files
committed
[cmake] Extend zstd.dll finding logic from MSVC to WIN32 in general
Extend the special logic for finding `zstd.dll` in `Findzstd` to apply to all Windows configurations rather than just MSVC. From what I understand, this naming scheme is specific to Windows in general, rather than "Windows with MSVC", and `.lib` files are always used to link to shared libraries. I could reproduce the original problem when using Clang with Conda-installed LLVM, and extending the logic to `WIN32` seems to fix it for me. That said, I'm not an expert on Windows and I have only done very limited testing, so I'd appreciate if someone could double check that I'm not breaking some workflow. Fixes #121345
1 parent ed572f2 commit 003686f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/cmake/modules/Findzstd.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# zstd::libzstd_shared
1111
# zstd::libzstd_static
1212

13-
if(MSVC)
13+
if(WIN32)
1414
set(zstd_STATIC_LIBRARY_SUFFIX "_static\\${CMAKE_STATIC_LIBRARY_SUFFIX}$")
1515
else()
1616
set(zstd_STATIC_LIBRARY_SUFFIX "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$")
@@ -33,7 +33,7 @@ if(zstd_FOUND)
3333
set(zstd_STATIC_LIBRARY "${zstd_LIBRARY}")
3434
elseif (NOT TARGET zstd::libzstd_shared)
3535
add_library(zstd::libzstd_shared SHARED IMPORTED)
36-
if(MSVC)
36+
if(WIN32)
3737
include(GNUInstallDirs) # For CMAKE_INSTALL_LIBDIR and friends.
3838
# IMPORTED_LOCATION is the path to the DLL and IMPORTED_IMPLIB is the "library".
3939
get_filename_component(zstd_DIRNAME "${zstd_LIBRARY}" DIRECTORY)

0 commit comments

Comments
 (0)