[llvm] [llvm-mt] Do not build llvm-mt if not functional (PR #134631)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 06:47:27 PDT 2025


https://github.com/Meinersbur created https://github.com/llvm/llvm-project/pull/134631

llvm-mt requires libxml2 to work, so do not even build it without libxml2.

Since CMake 


>From 6e45dd0ebaae3864036e14b29ba1206ed6fcfac6 Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Mon, 7 Apr 2025 15:44:28 +0200
Subject: [PATCH] Do not build llvm-mt if not functional

---
 llvm/tools/llvm-mt/CMakeLists.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/llvm/tools/llvm-mt/CMakeLists.txt b/llvm/tools/llvm-mt/CMakeLists.txt
index dd427a2640cd6..baa9f986a85b3 100644
--- a/llvm/tools/llvm-mt/CMakeLists.txt
+++ b/llvm/tools/llvm-mt/CMakeLists.txt
@@ -1,3 +1,8 @@
+if (NOT LLVM_ENABLE_LIBXML2)
+  message(STATUS "Not building llvm-mt${CMAKE_EXECUTABLE_SUFFIX} because libxml2 is not available")
+  return()
+endif ()
+
 set(LLVM_LINK_COMPONENTS
   Option
   Support



More information about the llvm-commits mailing list