[llvm] b1e92f8 - [llvm] Don't require third-party components when cross-compiling

Michał Górny via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 14 09:13:21 PST 2023


Author: James Le Cuirot
Date: 2023-01-14T18:12:39+01:00
New Revision: b1e92f8def98c5e34fdb3b4c18ac16d65fb613a2

URL: https://github.com/llvm/llvm-project/commit/b1e92f8def98c5e34fdb3b4c18ac16d65fb613a2
DIFF: https://github.com/llvm/llvm-project/commit/b1e92f8def98c5e34fdb3b4c18ac16d65fb613a2.diff

LOG: [llvm] Don't require third-party components when cross-compiling

It is possible to build LLVM with just the "llvm" and "cmake" components
checked out. This requires disabling the `LLVM_INCLUDE_BENCHMARKS` and
`LLVM_INCLUDE_TESTS` options. These options are not passed through to
the native build when cross-compiling though, so the build will break if
the "third-party" component is missing. We don't need the benchmarks or
tests for the native build, so disable these unconditionally. This fixes
cross-compiling on Gentoo, where only the required components are
checked out.

Differential Revision: https://reviews.llvm.org/D141196

Added: 
    

Modified: 
    llvm/cmake/modules/CrossCompile.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
index 52b893dd0214b..a46a0fd630b0f 100644
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -84,6 +84,8 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
         -DLLVM_ENABLE_RUNTIMES="${llvm_enable_runtimes_arg}"
         ${external_project_source_dirs}
         -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}"
+        -DLLVM_INCLUDE_BENCHMARKS=OFF
+        -DLLVM_INCLUDE_TESTS=OFF
         ${build_type_flags} ${linker_flag} ${external_clang_dir}
         ${ARGN}
     WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}


        


More information about the llvm-commits mailing list