Skip to content

Commit 37aaa06

Browse files
mgornytru
authored andcommitted
[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 62d0aff)
1 parent 56e8e04 commit 37aaa06

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(MSVC OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
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(MSVC OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
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)