[llvm-branch-commits] [llvm] 4bd3f37 - use LLVM_USE_STATIC_ZSTD

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Oct 4 02:30:25 PDT 2022


Author: Cole
Date: 2022-10-04T11:29:17+02:00
New Revision: 4bd3f3759259548e159aeba5c76efb9a0864e6fa

URL: https://github.com/llvm/llvm-project/commit/4bd3f3759259548e159aeba5c76efb9a0864e6fa
DIFF: https://github.com/llvm/llvm-project/commit/4bd3f3759259548e159aeba5c76efb9a0864e6fa.diff

LOG: 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 fc1da043f4f9198303abd6f643cf23439115ce73)

Added: 
    

Modified: 
    llvm/CMakeLists.txt
    llvm/lib/Support/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 75e97591c152..fddb8ffd0c16 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -446,7 +446,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 d53b21deb077..806cbc884cc5 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()
 


        


More information about the llvm-branch-commits mailing list