Skip to content

Commit

Permalink
use LLVM_USE_STATIC_ZSTD
Browse files Browse the repository at this point in the history
removes LLVM_PREFER_STATIC_ZSTD in favor of using a LLVM_USE_STATIC_ZSTD

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D133222
  • Loading branch information
ckissane committed Sep 2, 2022
1 parent acf1416 commit fc1da04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ set(LLVM_ENABLE_ZLIB "ON" CACHE STRING "Use zlib for compression/decompression i

set(LLVM_ENABLE_ZSTD "ON" CACHE STRING "Use zstd for compression/decompression if available. Can be ON, OFF, or FORCE_ON")

set(LLVM_PREFER_STATIC_ZSTD TRUE CACHE BOOL "Use static version of zstd if available. Can be TRUE, FALSE")
set(LLVM_USE_STATIC_ZSTD FALSE CACHE BOOL "Use static version of zstd. Can be TRUE, FALSE")

set(LLVM_ENABLE_CURL "OFF" CACHE STRING "Use libcurl for the HTTP client if available. Can be ON, OFF, or FORCE_ON")

Expand Down
16 changes: 3 additions & 13 deletions llvm/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,11 @@ if(LLVM_ENABLE_ZLIB)
list(APPEND imported_libs ZLIB::ZLIB)
endif()

set(zstd_target none)

if(LLVM_ENABLE_ZSTD)
if(LLVM_PREFER_STATIC_ZSTD)
if(TARGET zstd::libzstd_static)
set(zstd_target zstd::libzstd_static)
else()
set(zstd_target zstd::libzstd_shared)
endif()
if(TARGET zstd::libzstd_shared AND NOT LLVM_USE_STATIC_ZSTD)
set(zstd_target zstd::libzstd_shared)
else()
if(TARGET zstd::libzstd_shared)
set(zstd_target zstd::libzstd_shared)
else()
set(zstd_target zstd::libzstd_static)
endif()
set(zstd_target zstd::libzstd_static)
endif()
endif()

Expand Down

0 comments on commit fc1da04

Please sign in to comment.