Skip to content

Commit 4bd3f37

Browse files
ckissanetru
authored andcommitted
use LLVM_USE_STATIC_ZSTD
removes LLVM_PREFER_STATIC_ZSTD in favor of using a LLVM_USE_STATIC_ZSTD Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D133222 (cherry picked from commit fc1da04)
1 parent 55d4d86 commit 4bd3f37

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

llvm/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ set(LLVM_ENABLE_ZLIB "ON" CACHE STRING "Use zlib for compression/decompression i
446446

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

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

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

llvm/lib/Support/CMakeLists.txt

+3-13
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,11 @@ if(LLVM_ENABLE_ZLIB)
2525
list(APPEND imported_libs ZLIB::ZLIB)
2626
endif()
2727

28-
set(zstd_target none)
29-
3028
if(LLVM_ENABLE_ZSTD)
31-
if(LLVM_PREFER_STATIC_ZSTD)
32-
if(TARGET zstd::libzstd_static)
33-
set(zstd_target zstd::libzstd_static)
34-
else()
35-
set(zstd_target zstd::libzstd_shared)
36-
endif()
29+
if(TARGET zstd::libzstd_shared AND NOT LLVM_USE_STATIC_ZSTD)
30+
set(zstd_target zstd::libzstd_shared)
3731
else()
38-
if(TARGET zstd::libzstd_shared)
39-
set(zstd_target zstd::libzstd_shared)
40-
else()
41-
set(zstd_target zstd::libzstd_static)
42-
endif()
32+
set(zstd_target zstd::libzstd_static)
4333
endif()
4434
endif()
4535

0 commit comments

Comments
 (0)