summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-06 23:39:37 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-06 23:39:37 +0000
commitc1824769744d2052963962b2b8cbf0180bd4868b (patch)
treefd77cda3f8e4be7818b760cccdbf2e1c884f5a9e /examples
parent2848d9262016a14169a429c2fef9ae48570499b3 (diff)
cmake: Add Kaleidoscope target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/Kaleidoscope/CMakeLists.txt7
-rw-r--r--examples/Kaleidoscope/Chapter2/CMakeLists.txt2
-rw-r--r--examples/Kaleidoscope/Chapter3/CMakeLists.txt2
-rw-r--r--examples/Kaleidoscope/Chapter4/CMakeLists.txt2
-rw-r--r--examples/Kaleidoscope/Chapter5/CMakeLists.txt2
-rw-r--r--examples/Kaleidoscope/Chapter6/CMakeLists.txt2
-rw-r--r--examples/Kaleidoscope/Chapter7/CMakeLists.txt2
-rw-r--r--examples/Kaleidoscope/Chapter8/CMakeLists.txt2
8 files changed, 14 insertions, 7 deletions
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
)