Build test deps separately to avoid LD_LIBRARY_PATH interference

Otherwise invocations of host clang will use the newly built
libraries, which will use a non-existent resource directory, and
thus cause headers like stddef.h not to be found.
This commit is contained in:
Nikita Popov 2022-11-04 16:04:45 +01:00
parent abec3da8de
commit 71aa74debd
1 changed files with 4 additions and 0 deletions

View File

@ -469,6 +469,10 @@ ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format
%check
%if %{without compat_build}
%if %{with check}
# Build test dependencies separately, to prevent invocations of host clang from being affected
# by LD_LIBRARY_PATH below.
%cmake_build --target clang-test-depends \
ExtraToolsUnitTests ClangdUnitTests ClangIncludeCleanerUnitTests ClangPseudoUnitTests
# requires lit.py from LLVM utilities
# FIXME: Fix failing ARM tests
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || \