[PATCH] D70590: [Examples] Add add_llvm_example_library macro and use it for IR example.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 24 13:38:58 PST 2019


fhahn added a comment.

In D70590#1757902 <https://reviews.llvm.org/D70590#1757902>, @compnerd wrote:

> I think that rather than adding more wrapping macros, we should fix the structure.  We can mark the examples directory from `ALL` at the `add_subdirectory` level and only add the subdirectory when examples are enabled.  This avoids the need for the new macro.  I think that we want to move towards a more standard cmake build rather than a more specialized one.


I think sticking to more standard cmake is great. My Cmake is a bit rusty, are you suggesting to just not add the examples directory (guarding  `add_subdirectory` with `LLVM_BUILD_EXAMPLES`)?

I think that would change the behavior slightly, because currently IIUC we always add the example targets, we just not build them by default and also update the target directory for installing them and it would be valuable to keep the current behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70590





More information about the llvm-commits mailing list