diff --git a/examples/Kaleidoscope/CMakeLists.txt b/examples/Kaleidoscope/CMakeLists.txt index 25e5745626e..53c724f1a2d 100644 --- a/examples/Kaleidoscope/CMakeLists.txt +++ b/examples/Kaleidoscope/CMakeLists.txt @@ -1,3 +1,10 @@ +add_custom_target(Kaleidoscope) + +macro(add_kaleidoscope_chapter name) + add_dependencies(Kaleidoscope ${name}) + add_llvm_example(${name} ${ARGN}) +endmacro(add_kaleidoscope_chapter name) + add_subdirectory(Chapter2) add_subdirectory(Chapter3) add_subdirectory(Chapter4) diff --git a/examples/Kaleidoscope/Chapter2/CMakeLists.txt b/examples/Kaleidoscope/Chapter2/CMakeLists.txt index 79f2b172d0d..fed3f4b78c7 100644 --- a/examples/Kaleidoscope/Chapter2/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter2/CMakeLists.txt @@ -1,3 +1,3 @@ -add_llvm_example(Kaleidoscope-Ch2 +add_kaleidoscope_chapter(Kaleidoscope-Ch2 toy.cpp ) diff --git a/examples/Kaleidoscope/Chapter3/CMakeLists.txt b/examples/Kaleidoscope/Chapter3/CMakeLists.txt index a98d7df1049..8053c968f3d 100644 --- a/examples/Kaleidoscope/Chapter3/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter3/CMakeLists.txt @@ -3,6 +3,6 @@ set(LLVM_LINK_COMPONENTS Support ) -add_llvm_example(Kaleidoscope-Ch3 +add_kaleidoscope_chapter(Kaleidoscope-Ch3 toy.cpp ) diff --git a/examples/Kaleidoscope/Chapter4/CMakeLists.txt b/examples/Kaleidoscope/Chapter4/CMakeLists.txt index 86336debc87..45e92e4b8ca 100644 --- a/examples/Kaleidoscope/Chapter4/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter4/CMakeLists.txt @@ -10,6 +10,6 @@ set(LLVM_LINK_COMPONENTS mcjit ) -add_llvm_example(Kaleidoscope-Ch4 +add_kaleidoscope_chapter(Kaleidoscope-Ch4 toy.cpp ) diff --git a/examples/Kaleidoscope/Chapter5/CMakeLists.txt b/examples/Kaleidoscope/Chapter5/CMakeLists.txt index e920f0e3445..5aac67485e1 100644 --- a/examples/Kaleidoscope/Chapter5/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter5/CMakeLists.txt @@ -10,6 +10,6 @@ set(LLVM_LINK_COMPONENTS mcjit ) -add_llvm_example(Kaleidoscope-Ch5 +add_kaleidoscope_chapter(Kaleidoscope-Ch5 toy.cpp ) diff --git a/examples/Kaleidoscope/Chapter6/CMakeLists.txt b/examples/Kaleidoscope/Chapter6/CMakeLists.txt index 9ffd86a65f9..c5a737ac67f 100644 --- a/examples/Kaleidoscope/Chapter6/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter6/CMakeLists.txt @@ -10,6 +10,6 @@ set(LLVM_LINK_COMPONENTS mcjit ) -add_llvm_example(Kaleidoscope-Ch6 +add_kaleidoscope_chapter(Kaleidoscope-Ch6 toy.cpp ) diff --git a/examples/Kaleidoscope/Chapter7/CMakeLists.txt b/examples/Kaleidoscope/Chapter7/CMakeLists.txt index 12d745766cd..19fdb95d765 100644 --- a/examples/Kaleidoscope/Chapter7/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter7/CMakeLists.txt @@ -13,6 +13,6 @@ set(LLVM_LINK_COMPONENTS set(LLVM_REQUIRES_RTTI 1) -add_llvm_example(Kaleidoscope-Ch7 +add_kaleidoscope_chapter(Kaleidoscope-Ch7 toy.cpp ) diff --git a/examples/Kaleidoscope/Chapter8/CMakeLists.txt b/examples/Kaleidoscope/Chapter8/CMakeLists.txt index 84436289d2c..1a957722399 100644 --- a/examples/Kaleidoscope/Chapter8/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter8/CMakeLists.txt @@ -13,6 +13,6 @@ set(LLVM_LINK_COMPONENTS set(LLVM_REQUIRES_RTTI 1) -add_llvm_example(Kaleidoscope-Ch8 +add_kaleidoscope_chapter(Kaleidoscope-Ch8 toy.cpp )