[llvm] [flang-rt] Disable tests by default when cross-compiling (PR #208926)
Mark Zhuang via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 11 09:32:29 PDT 2026
https://github.com/zqb-all created https://github.com/llvm/llvm-project/pull/208926
Cross-compiled tests can't run on the build host and pull in host dependencies (e.g. LLVMSupport's ZLIB::ZLIB) that break the build.
Fixes #208924
>From c006ddb83fb28c8bcd77104ff0103a7fe1ed47f2 Mon Sep 17 00:00:00 2001
From: Mark Zhuang <mark.zhuang at spacemit.com>
Date: Sat, 11 Jul 2026 23:33:50 +0800
Subject: [PATCH] [flang-rt] Disable tests by default when cross-compiling
Cross-compiled tests can't run on the build host and pull in host
dependencies (e.g. LLVMSupport's ZLIB::ZLIB) that break the build.
Fixes #208924
---
flang-rt/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/flang-rt/CMakeLists.txt b/flang-rt/CMakeLists.txt
index 22587022882b8..c0c1dcd1af642 100644
--- a/flang-rt/CMakeLists.txt
+++ b/flang-rt/CMakeLists.txt
@@ -127,6 +127,8 @@ elseif (NOT FLANG_RT_FORTRAN_MODULES)
set(FLANG_RT_INCLUDE_TESTS_default OFF)
elseif (NOT FLANG_RT_ENABLE_STATIC AND NOT FLANG_RT_ENABLE_SHARED)
set(FLANG_RT_INCLUDE_TESTS_default OFF)
+elseif (CMAKE_CROSSCOMPILING)
+ set(FLANG_RT_INCLUDE_TESTS_default OFF)
endif()
option(FLANG_RT_INCLUDE_TESTS "Generate build targets for the flang-rt unit and regression-tests." "${FLANG_RT_INCLUDE_TESTS_default}")
if (FLANG_RT_INCLUDE_TESTS AND NOT FLANG_RT_ENABLE_STATIC AND NOT FLANG_RT_ENABLE_SHARED)
More information about the llvm-commits
mailing list