This is an archive of the discontinued LLVM Phabricator instance.

CMake: Only add test/ subdirectory when it exists
ClosedPublic

Authored by dexonsmith on May 3 2017, 4:36 PM.

Details

Reviewers
EricWF
Summary

CMake: Only add test/ subdirectory when it exists

r296685 started adding the test/ subdirectory even when
LIBCXX_INCLUDE_TESTS=OFF. This is great for testing libcxx standalone,
but it also breaks the build when the test/ subdirectory is removed
(and our submission system strips all test/ directories).

This patch updates the logic to check for test/ before adding it.

rdar://problem/31931366

Diff Detail

Event Timeline

dexonsmith created this revision.May 3 2017, 4:36 PM
EricWF accepted this revision.May 3 2017, 4:45 PM

I'm OK with this patch because it's minimally invasive. However it seems strange to support arbitrary configurations that delete random parts of the source tree.

This revision is now accepted and ready to land.May 3 2017, 4:45 PM

Thanks for being flexible; committed in r302095. Maybe longer term we could add a CMake configuration for whether to include the tests, but naming it might be hard ;).

dexonsmith closed this revision.May 3 2017, 4:49 PM