[llvm] cmake config groundwork to have ZSTD in LLVM
authorCole Kissane <cole.kissane@gmail.com>
Fri, 8 Jul 2022 19:36:27 +0000 (12:36 -0700)
committerCole Kissane <cole.kissane@gmail.com>
Fri, 8 Jul 2022 19:36:27 +0000 (12:36 -0700)
- added `FindZSTD.cmake`
- added a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring that of `LLVM_ENABLE_ZLIB`
- likewise added have_zstd to compiler-rt/test/lit.common.cfg.py, clang-tools-extra/clangd/test/lit.cfg.py, and several lit.site.cfg.py.in files mirroring have_zlib behavior

Reviewed By: leonardchan, MaskRay

Differential Revision: https://reviews.llvm.org/D128465

compiler-rt/test/lit.common.cfg.py
llvm/lib/Support/CMakeLists.txt

index a38c1308ecf43e8066d9554d0fe3bc59e10f758d..90a6b0fa33820d7cf354d3234a3770b7a8fa3c82 100644 (file)
@@ -217,7 +217,7 @@ config.available_features.add("host-byteorder-" + sys.byteorder + "-endian")
 
 if config.have_zlib == "1":
   config.available_features.add("zlib")
-  
+
 if config.have_zstd == "1":
   config.available_features.add("zstd")
 
index e1045e459d7062d666dca8aef6dfcce9a6c2693d..52b95c5377d340fdc3874d582249d6fb42399f49 100644 (file)
@@ -25,6 +25,10 @@ if(LLVM_ENABLE_ZLIB)
   set(imported_libs ZLIB::ZLIB)
 endif()
 
+if(LLVM_ENABLE_ZSTD)
+  list(APPEND imported_libs zstd)
+endif()
+
 if( MSVC OR MINGW )
   # libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
   # advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.