From 6a2d235ffd073744fe0f48b3879608666d44591d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 26 Jun 2025 13:41:05 +0300 Subject: [PATCH] Revert "build-lldb-mi: Disallow detecting LLVM outside of $LLVM_DIR" This reverts commit 9e628b0f2d1b893643b0542ecd4cdfb891e43520. If LLVM was built with --disable-dylib, then the individual LLVM libraries may expose a dependency on zlib. By restricting the lldb-mi build to detect dependencies outside of $LLVM_DIR, the build of lldb-mi fails to find zlib, making it impossible to find all the necessary dependencies, ending up with errors like this: CMake Error at llvm-mingw/llvm-project/llvm/build-asserts/lib/cmake/llvm/LLVMExports.cmake:55 (set_target_properties): The link interface of target "LLVMSupport" contains: ZLIB::ZLIB but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. Revert this change for now, to allow building lldb-mi against a non-dylib build of LLVM. --- build-lldb-mi.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build-lldb-mi.sh b/build-lldb-mi.sh index 1dd6b13..ebc4db0 100755 --- a/build-lldb-mi.sh +++ b/build-lldb-mi.sh @@ -65,7 +65,7 @@ else esac fi -LLVM_DIR="$PREFIX" +export LLVM_DIR="$PREFIX" # Try to find/guess the builddir under the llvm buildtree next by. # If LLVM was built without LLVM_INSTALL_TOOLCHAIN_ONLY, and the LLVM @@ -91,7 +91,7 @@ if [ -d "$LLVM_SRC" ]; then done if [ -n "$DIRS" ]; then dir="$(ls -td $DIRS | head -1)" - LLVM_DIR="$LLVM_SRC/$dir" + export LLVM_DIR="$LLVM_SRC/$dir" echo Using $LLVM_DIR as LLVM build dir break else @@ -121,13 +121,13 @@ if [ -n "$HOST" ]; then exit 1 ;; esac -fi -CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH=$LLVM_DIR" -CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER" -CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY" -CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY" -CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY" + CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH=$LLVM_DIR" + CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER" + CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY" + CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY" + CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY" +fi if [ -n "$MACOS_REDIST" ]; then : ${MACOS_REDIST_ARCHS:=arm64 x86_64}