[PATCH] D31696: Automatically add include-what-you-use for when building in tree

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 10 11:06:10 PDT 2017


beanz added inline comments.


================
Comment at: clang/tools/.gitignore:12
+#==============================================================================#
+# The include-what-you-use project, for when building in-tree.
+include-what-you-use
----------------
rnk wrote:
> LLVM doesn't currently have any .gitignore files for other projects, and they don't show up in `git status`. What's the difference here?
We actually should put this into the clang/.gitignore instead of a separate .gitignore in the tools directory. That is how we've done things in LLVM & Clang before.


================
Comment at: clang/tools/CMakeLists.txt:35
+# if include-what-you-use is cloned for building in-tree, add it here.
+if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include-what-you-use")
+  add_clang_subdirectory(include-what-you-use)
----------------
rnk wrote:
> Maybe we should do `llvm_add_implicit_projects(CLANG)` here instead?
> 
> Or do we not want clang/tools to be a project extension point? Would IWYU build fine if we added it to llvm/projects or llvm/tools? Maybe we should just recommend that.
Either `llvm_add_implicit_projects(CLANG)` or `add_llvm_external_project(include-what-you-use include-what-you-use)`.

The former case would make this a generic extension point, which I think is good, the later would add just this project without needing to wrap it in an `if`.

I would prefer going the implicit route because I actually have a distaste for having code living in-tree that is specifically for supporting out-of-tree code.


https://reviews.llvm.org/D31696





More information about the cfe-commits mailing list