From adf1ffe95854a245cbc48bbaea55f60b003d5f76 Mon Sep 17 00:00:00 2001 From: Cole Kissane Date: Fri, 8 Jul 2022 12:36:27 -0700 Subject: [PATCH] [llvm] cmake config groundwork to have ZSTD in LLVM - 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 | 2 +- llvm/lib/Support/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index a38c1308ecf4..90a6b0fa3382 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -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") diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index e1045e459d70..52b95c5377d3 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -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.