[PATCH] D85140: [RFC] Factor out repetitive cmake patterns for llvm-style projects

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 00:56:13 PDT 2020


phosek added a comment.

In D85140#2310962 <https://reviews.llvm.org/D85140#2310962>, @stephenneuendorffer wrote:

> Thanks Petr.  Can you point to some example projects where some of these
> targets are harmful?  Personally I'm willing to accept that some of the
> mechanisms here might not be used by all projects in exchange for
> simplification and ease of use.
>
> Steve

I don't think any of these are harmful, they are just not needed in most projects.

- `*_INCLUDE_UTILS`, `*_BUILD_UTILS` and `*_INSTALL_UTILS` is only relevant in LLVM which is the only project that uses this concept.
- `*_BUILD_TOOLS` is used by Clang, Flang, LLD and LLVM, `*_INCLUDE_TOOLS` is used by LLVM only.
- `*_INSTALL_TOOLCHAIN_ONLY` is defined in LLVM and while other projects use this variable, it's used as a global shared variable and it doesn't make sense to define it for each project. Maybe we should rename `LLVM_INSTALL_TOOLCHAIN_ONLY` to `INSTALL_TOOLCHAIN_ONLY`?
- `*_INCLUDE_EXAMPLES` and `*_BUILD_EXAMPLES` is only used by Clang, LLVM and MLIR.
- While `*_BUILD_TESTS` is only used by LLVM, `*_INCLUDE_TESTS` is used by all projects. In some cases, `*_BUILD_TESTS` might make sense even for projects that don't use them currently. For example, Clang uses `add_unittest` so whether those are built is controlled by `LLVM_BUILD_TESTS`, but perhaps there should be `CLANG_BUILD_TESTS`?
- `*_INCLUDE_INTEGRATION_TESTS` is only used by MLIR.
- `*_INCLUDE_DOCS` is used by all projects.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85140/new/

https://reviews.llvm.org/D85140



More information about the llvm-commits mailing list