2019-04-03 01:02:07 +08:00
|
|
|
add_custom_target(Toy)
|
|
|
|
set_target_properties(Toy PROPERTIES FOLDER Examples)
|
|
|
|
|
|
|
|
macro(add_toy_chapter name)
|
|
|
|
add_dependencies(Toy ${name})
|
[RFC] Factor out repetitive cmake patterns for llvm-style projects
New projects (particularly out of tree) have a tendency to hijack the existing
llvm configuration options and build targets (add_llvm_library,
add_llvm_tool). This can lead to some confusion.
1) When querying a configuration variable, do we care about how LLVM was
configured, or how these options were configured for the out of tree project?
2) LLVM has lots of defaults, which are easy to miss
(e.g. LLVM_BUILD_TOOLS=ON). These options all need to be duplicated in the
CMakeLists.txt for the project.
In addition, with LLVM Incubators coming online, we need better ways for these
incubators to do things the "LLVM way" without alot of futzing. Ideally, this
would happen in a way that eases importing into the LLVM monorepo when
projects mature.
This patch creates some generic infrastructure in llvm/cmake/modules and
refactors MLIR to use this infrastructure. This should expand to include
add_xxx_library, which is by far the most complicated bit of building a
project correctly, since it has to deal with lots of shared library
configuration bits. (MLIR currently hijacks the LLVM infrastructure for
building libMLIR.so, so this needs to get refactored anyway.)
Differential Revision: https://reviews.llvm.org/D85140
2020-08-04 02:24:15 +08:00
|
|
|
add_mlir_example(${name} ${ARGN})
|
2019-04-03 01:02:07 +08:00
|
|
|
endmacro(add_toy_chapter name)
|
|
|
|
|
|
|
|
add_subdirectory(Ch1)
|
2019-04-03 04:11:20 +08:00
|
|
|
add_subdirectory(Ch2)
|
2019-04-04 09:45:01 +08:00
|
|
|
add_subdirectory(Ch3)
|
2019-04-05 09:31:31 +08:00
|
|
|
add_subdirectory(Ch4)
|
2019-04-09 14:00:49 +08:00
|
|
|
add_subdirectory(Ch5)
|
2019-10-18 05:21:44 +08:00
|
|
|
add_subdirectory(Ch6)
|
2019-11-08 01:53:27 +08:00
|
|
|
add_subdirectory(Ch7)
|