[llvm] [cmake] Pass cached library variables only if target matches host (PR #227660)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 30 05:26:05 PDT 2026
================
@@ -174,26 +174,31 @@ function(llvm_ExternalProject_Add name source_dir)
set_target_properties(${name}-clear PROPERTIES FOLDER "${ARG_FOLDER}")
endif ()
- set(DEFAULT_PASSTHROUGH_VARIABLES
- LibEdit_INCLUDE_DIRS
- LibEdit_LIBRARIES
- ZLIB_INCLUDE_DIR
- ZLIB_LIBRARY
- ZLIB_LIBRARY_RELEASE
- ZLIB_LIBRARY_DEBUG
- zstd_INCLUDE_DIR
- zstd_LIBRARY
- LIBXML2_LIBRARY
- LIBXML2_INCLUDE_DIR
- CURL_INCLUDE_DIR
- CURL_LIBRARY
- HTTPLIB_INCLUDE_DIR
- HTTPLIB_HEADER_PATH
- Python3_EXECUTABLE
- Python3_LIBRARIES
- Python3_INCLUDE_DIRS
- Python3_RPATH
- )
+ # Add only if the target matches.
+ # Otherwise LLVMConfig.cmake dependency finding will short-circuit to incompatible host system libraries.
+ if("${ARG_TARGET_TRIPLE}" STREQUAL "${LLVM_TARGET_TRIPLE}")
----------------
jhuber6 wrote:
It depends on what this is trying to solve, if we just need a rough check for 'same processor' then just the first component after splitting by `-` would be sufficient. i.e. x86_64 vs. x86_64, but I don't fully know which problem this is solving.
https://github.com/llvm/llvm-project/pull/227660
More information about the llvm-commits
mailing list