Page MenuHomePhabricator

[compiler-rt] [xray] [tests] Detect and handle missing LLVMTestingSupport gracefully

Authored by mgorny on Dec 19 2018, 9:17 AM.



Add a code to properly test for presence of LLVMTestingSupport library
when performing a stand-alone build, and skip tests requiring it when
it is not present. Since the library is not installed, llvm-config
reported empty --libs for it and the tests failed to link with undefined
references. Skipping the two fdr_* test files is better than failing to
build, and should be good enough until we find a better solution.

NB: both installing LLVMTestingSupport and building it automatically
from within compiler-rt sources are non-trivial. The former due to
dependency on gtest, the latter due to tight integration with LLVM
source tree.

Diff Detail


Event Timeline

mgorny created this revision.Dec 19 2018, 9:17 AM
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptDec 19 2018, 9:17 AM
dberris accepted this revision.Dec 20 2018, 6:59 PM


Thanks, @mgorny!

This revision is now accepted and ready to land.Dec 20 2018, 6:59 PM
This revision was automatically updated to reflect the committed changes.

In case compiler-rt abandons llvm-config in favor of find_package(LLVM) one day, we could drop the COMPILER_RT_HAS_LLVMTESTINGSUPPORT logic here and use imported target properties instead. It seems a cleaner solution to me and avoids issues like D57521.