From fc1da043f4f9198303abd6f643cf23439115ce73 Mon Sep 17 00:00:00 2001 From: Cole Date: Fri, 2 Sep 2022 21:00:07 +0000 Subject: [PATCH] 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 --- llvm/CMakeLists.txt | 2 +- llvm/lib/Support/CMakeLists.txt | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 8be03bedad82a5..1e8e53c414fdd6 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -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") diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index 636235081688a2..c6a04fdb665992 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -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()