This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Support tests in runtimes layout
AbandonedPublic

Authored by phosek on Feb 5 2019, 11:40 AM.

Details

Summary

When libunwind and libc++abi is build in the runtimes layout,
we set <PROJECT>_STANDALONE_BUILD but at the same time the condition
CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR isn't true since
we're building in llvm/runtimes. Handle this case in the CMake build
to avoid disabling tests.

Diff Detail

Event Timeline

phosek created this revision.Feb 5 2019, 11:40 AM

@phosek and I discussed this on IRC, and I'm summarizing our discussion here. We're not sure if it actually makes sense for the runtimes build to set the *_STANDALONE_BUILD variables, and he was gonna play with that.

libcxxabi/CMakeLists.txt
484

This seems pretty subtle. The condition seems to care about whether we're building libc++ alongside libc++abi; perhaps adding AND NOT HAVE_LIBCXX to the condition would be enough?

libunwind/CMakeLists.txt
366

This feels a little strange because the test would suggest that LLVM_CMAKE_PATH is important for the test subdirectory, but apparently things work fine without it. Is there any other condition that could work here?

phosek abandoned this revision.Feb 8 2019, 7:07 PM

We came up with a better solution in D57992.