Skip to content

Commit

Permalink
[CMake] Move find_package(ZLIB) to LLVMConfig
Browse files Browse the repository at this point in the history
This way, downstream projects don't have to invoke find_package(ZLIB)
reducing the amount of boilerplate.

Differential Revision: https://reviews.llvm.org/D84691
  • Loading branch information
petrhosek committed Jul 28, 2020
1 parent f250eb3 commit 64d99cc
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 16 deletions.
4 changes: 0 additions & 4 deletions clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
option(CLANG_ENABLE_BOOTSTRAP "Generate the clang bootstrap target" OFF)
option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON)

if(LLVM_ENABLE_ZLIB)
find_package(ZLIB)
endif()

include(AddLLVM)
include(TableGen)
include(HandleLLVMOptions)
Expand Down
4 changes: 0 additions & 4 deletions lld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)

if(LLVM_ENABLE_ZLIB)
find_package(ZLIB)
endif()

include(AddLLVM)
include(TableGen)
include(HandleLLVMOptions)
Expand Down
4 changes: 0 additions & 4 deletions lldb/cmake/modules/LLDBStandalone.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ endif()
# CMake modules to be in that directory as well.
list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")

if(LLVM_ENABLE_ZLIB)
find_package(ZLIB)
endif()

include(AddLLVM)
include(TableGen)
include(HandleLLVMOptions)
Expand Down
3 changes: 3 additions & 0 deletions llvm/cmake/modules/LLVMConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@)
set(LLVM_ENABLE_UNWIND_TABLES @LLVM_ENABLE_UNWIND_TABLES@)

set(LLVM_ENABLE_ZLIB @LLVM_ENABLE_ZLIB@)
if(LLVM_ENABLE_ZLIB)
find_package(ZLIB)
endif()

set(LLVM_LIBXML2_ENABLED @LLVM_LIBXML2_ENABLED@)

Expand Down
4 changes: 0 additions & 4 deletions mlir/examples/standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")

if(LLVM_ENABLE_ZLIB)
find_package(ZLIB)
endif()

include(TableGen)
include(AddLLVM)
include(AddMLIR)
Expand Down

0 comments on commit 64d99cc

Please sign in to comment.