Skip to content

Commit

Permalink
[llvm] Don't require third-party components when cross-compiling
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chewi authored and mgorny committed Jan 14, 2023
1 parent 1e60e7a commit b1e92f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/cmake/modules/CrossCompile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit b1e92f8

Please sign in to comment.