[clang] [clang] Gate llvm-mt on if libxml2 is provided (PR #217771)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 23:43:05 PDT 2026


================
@@ -508,6 +507,10 @@ set(LLVM_TOOLCHAIN_TOOLS
   scan-build-py
   CACHE STRING "")
 
+if(LLVM_ENABLE_LIBXML2)
+  list(APPEND LLVM_TOOLCHAIN_TOOLS llvm-mt)
----------------
petrhosek wrote:

The `LLVM_TOOLCHAIN_TOOLS` variable set above is cached so you cannot just append to it here. You need to create a new variable to collect all dependencies, e.g. `TOOLCHAIN_TOOLS`, and then set the cache value:
```
set(LLVM_TOOLCHAIN_TOOLS "${TOOLCHAIN_TOOLS}" CACHE STRING "")
```
This is the pattern we also use for `LLVM_BUILTIN_TARGETS` and `LLVM_RUNTIME_TARGETS` above.

https://github.com/llvm/llvm-project/pull/217771


More information about the cfe-commits mailing list