Add the CMake bits necessary to run lld tests (and unittests) when
building stand-alone. The code is based on the equivalent code in clang,
and includes:
- checking for Python, searching for lit and necessary LLVM test tools
(FileCount and not),
- building LLVM test tools (FileCount and not) from LLVM sources if
they are not installed,
- building gtest libraries from LLVM sources,
- adjusting dependencies so that test targets depend only on those LLVM
targets that are available for a particular variant of stand-alone
build.
With this patch, I am able to successfully run 1002 (+10 unsupported)
lit tests on Gentoo using installed LLVM.