This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Include LLVMTestingSupport when doing stand-alone build
ClosedPublic

Authored by mgorny on Apr 7 2018, 1:46 PM.

Details

Summary

Explicitly include and build lib/Testing/Support from LLVM sources when
doing a stand-alone build. This is necessary since clangd tests started
to depend on LLVMTestingSupport library which is neither installed
by LLVM, nor built by clang itself.

Since completely separate build of clang-tools-extra is not supported,
this relies on variables set by clang CMakeLists.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Apr 7 2018, 1:46 PM

This LG to fix the standalone build.
However, why not install LLVMTestingSupport in llvm? It feels that we should either include it or disable the tests for standalone builds. And disabling the tests seems wrong.
WDYT?
@sammccall, in case he also has an opinion on this.

sammccall accepted this revision.Apr 9 2018, 2:06 AM

This seems fine to me too to fix the immediate issue.

Personally I'd rather drop our usage of llvmtestingsupport as it provides marginal value anyway. But also happy to do this as a cleanup afterwards.

Installing it in llvm seems like a good idea to me too, but outside my area.

This revision is now accepted and ready to land.Apr 9 2018, 2:06 AM
mgorny added a comment.Apr 9 2018, 2:43 AM

I've based this change on an earlier fix to lldb when that project started using LLVMTestingSupport.

That change in turn was based on how we handle gtest across the projects. As for gtest, I think installing was not considered as an option since different projects may build it with different flags. However, I did not investigate it in detail.

I don't specifically mind installing LLVMTestingSupport in any way. This solution was simply the least effort way of solving the immediate problem, given that we need LLVM sources for gtest anyway.

This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.