clover: Check if the detected clang libraries are usable
clang-cpp.so is broken in LLVM-9 and doesn't exist in LLVM<9,
however meson will find and try to use system libraries in these cases.
v2: Use helper variable to dedpulicate test code
Move second test inside the condition to avoid testing good clang-cpp twice
v3: Check for cross compilation
v4: style fixes
Fixes: ff1a3a00cb37d84ab9a563f0aa241714876f56b4
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Tested-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4457>