Skip to content

Fix the issue of linking a wrong import library of zstd #134812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions llvm/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,18 @@ if(LLVM_ENABLE_ZSTD)
# CMAKE_BUILD_TYPE is only meaningful to single-configuration generators.
if(CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION_${build_type})
if(MSVC)
get_property(zstd_library TARGET ${zstd_target} PROPERTY IMPORTED_IMPLIB_${build_type})
else()
get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION_${build_type})
endif()
endif()
if(NOT zstd_library)
get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION)
if(MSVC)
get_property(zstd_library TARGET ${zstd_target} PROPERTY IMPORTED_IMPLIB)
else()
get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION)
endif()
endif()
if (zstd_target STREQUAL zstd::libzstd_shared)
get_library_name(${zstd_library} zstd_library)
Expand Down