Commit e406cca5 authored by James Henderson's avatar James Henderson
Browse files

Revert "build: reduce CMake handling for zlib"

This reverts commit 68a235d0.

This commit broke the clang-x64-windows-msvc build bot and a follow-up
commit did not fix it. Reverting to fix the bot.
parent 34397b75
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -9,13 +9,22 @@ endif ()

string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})

if(CLANG_BUILT_STANDALONE)
  # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
  # value is forced to 0 if zlib was not found, so it is fine to use it
  # instead of HAVE_LIBZ (not recorded).
  if(LLVM_ENABLE_ZLIB)
    set(HAVE_LIBZ 1)
  endif()
endif()

llvm_canonicalize_cmake_booleans(
  CLANG_BUILD_EXAMPLES
  CLANG_ENABLE_ARCMT
  CLANG_ENABLE_STATIC_ANALYZER
  ENABLE_BACKTRACES
  ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER
  LLVM_ENABLE_ZLIB
  HAVE_LIBZ
  LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
  LLVM_ENABLE_PLUGINS
  LLVM_ENABLE_THREADS)
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.host_cxx = "@CMAKE_CXX_COMPILER@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.have_zlib = @LLVM_ENABLE_ZLIB@
config.have_zlib = @HAVE_LIBZ@
config.clang_arcmt = @CLANG_ENABLE_ARCMT@
config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@"
config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ if config.enable_per_target_runtime_dir:
else:
  set_default("target_suffix", "-%s" % config.target_arch)

set_default("have_zlib", "@LLVM_ENABLE_ZLIB@")
set_default("have_zlib", "@HAVE_LIBZ@")
set_default("libcxx_used", "@LLVM_LIBCXX_USED@")

# LLVM tools dir can be passed in lit parameters, so try to
+10 −1
Original line number Diff line number Diff line
@@ -4,8 +4,17 @@ set(LLVM_BUILD_MODE "%(build_mode)s")
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")

if(LLD_BUILT_STANDALONE)
  # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
  # value is forced to 0 if zlib was not found, so it is fine to use it
  # instead of HAVE_LIBZ (not recorded).
  if(LLVM_ENABLE_ZLIB)
    set(HAVE_LIBZ 1)
  endif()
endif()

llvm_canonicalize_cmake_booleans(
  LLVM_ENABLE_ZLIB
  HAVE_LIBZ
  LLVM_LIBXML2_ENABLED
  )

+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.have_zlib = @LLVM_ENABLE_ZLIB@
config.have_zlib = @HAVE_LIBZ@
config.sizeof_void_p = @CMAKE_SIZEOF_VOID_P@

# Support substitution of the tools and libs dirs with user parameters. This is
Loading