[PATCH] D26375: [libc++] Compare to libc++ source directory for out-of-source check

Chris Bieneman via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 7 19:40:57 PST 2016


beanz added a comment.

This patch doesn't make sense to me.

In an in-tree build `CMAKE_SOURCE_DIR` would be the LLVM source directory which shouldn't match your `CMAKE_BINARY_DIR`.

In an out-of-tree build `CMAKE_SOURCE_DIR` would match the libcxx sure directory, which shouldn't match `CMAKE_BINARY_DIR`.

In an out-of-tree build `CMAKE_SOURCE_DIR` and `CMAKE_CURRENT_SOURCE_DIR`, and for an in-tree build (where they would be different) there should be no situation where the `CMAKE_CURRENT_SOURCE_DIR` could possibly be equal to the current source directory unless the user does something *really* strange.

By *really* strange I mean a workflow that involved checking out LLVM, and libcxx, then configuring LLVM from inside the libcxx directory. If we're looking to capture that kind of situation (configuring a build inside an arbitrary directory in the source tree) our existing mechanisms are insufficient in a great many ways, so I don't think we should go down that path.

If you think this patch is important can you please explain the specific cases where this catches errors that the current code doesn't?


https://reviews.llvm.org/D26375





More information about the cfe-commits mailing list