summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2011-07-25 17:25:10 +0000
committerOscar Fuentes <ofv@wanadoo.es>2011-07-25 17:25:10 +0000
commitdb96ee8bbf6e333190db019ddee032e7fc2474fa (patch)
tree2160cff4434dab6814a0481ffd094afb1ea9e9af
parent4623678a75143e955c940be09723276239b9ef8a (diff)
downloadbcm5719-llvm-db96ee8bbf6e333190db019ddee032e7fc2474fa.tar.gz
bcm5719-llvm-db96ee8bbf6e333190db019ddee032e7fc2474fa.zip
Builds llvmc and its examples with CMake.
Patch by arrowdodger! llvm-svn: 135919
-rw-r--r--llvm/tools/llvmc/CMakeLists.txt6
-rw-r--r--llvm/tools/llvmc/examples/CMakeLists.txt4
-rw-r--r--llvm/tools/llvmc/examples/Hello/CMakeLists.txt4
-rw-r--r--llvm/tools/llvmc/examples/Simple/CMakeLists.txt10
-rw-r--r--llvm/tools/llvmc/examples/Skeleton/CMakeLists.txt11
-rw-r--r--llvm/tools/llvmc/examples/mcc16/CMakeLists.txt11
-rw-r--r--llvm/tools/llvmc/src/CMakeLists.txt19
7 files changed, 64 insertions, 1 deletions
diff --git a/llvm/tools/llvmc/CMakeLists.txt b/llvm/tools/llvmc/CMakeLists.txt
index 10ad5d82009..ff7cbae4837 100644
--- a/llvm/tools/llvmc/CMakeLists.txt
+++ b/llvm/tools/llvmc/CMakeLists.txt
@@ -1,4 +1,8 @@
-# add_subdirectory(src)
+add_subdirectory(src)
# TODO: support plugins and user-configured builds.
# See ./doc/LLVMC-Reference.rst "Customizing LLVMC: the compilation graph"
+
+if( LLVM_INCLUDE_EXAMPLES )
+ add_subdirectory(examples)
+endif()
diff --git a/llvm/tools/llvmc/examples/CMakeLists.txt b/llvm/tools/llvmc/examples/CMakeLists.txt
new file mode 100644
index 00000000000..2ad8aa4dc45
--- /dev/null
+++ b/llvm/tools/llvmc/examples/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_subdirectory(Hello)
+add_subdirectory(Simple)
+add_subdirectory(mcc16)
+add_subdirectory(Skeleton)
diff --git a/llvm/tools/llvmc/examples/Hello/CMakeLists.txt b/llvm/tools/llvmc/examples/Hello/CMakeLists.txt
new file mode 100644
index 00000000000..5679924bdb3
--- /dev/null
+++ b/llvm/tools/llvmc/examples/Hello/CMakeLists.txt
@@ -0,0 +1,4 @@
+set(LLVM_USED_LIBS CompilerDriver)
+set(LLVM_LINK_COMPONENTS support)
+
+add_llvm_example(Hello Hello.cpp)
diff --git a/llvm/tools/llvmc/examples/Simple/CMakeLists.txt b/llvm/tools/llvmc/examples/Simple/CMakeLists.txt
new file mode 100644
index 00000000000..8a401ea42ae
--- /dev/null
+++ b/llvm/tools/llvmc/examples/Simple/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(LLVM_TARGET_DEFINITIONS Simple.td)
+
+tablegen(Simple.inc -gen-llvmc)
+
+set(LLVM_USED_LIBS CompilerDriver)
+set(LLVM_LINK_COMPONENTS support)
+
+add_llvm_example(Simple
+ Simple.cpp
+ )
diff --git a/llvm/tools/llvmc/examples/Skeleton/CMakeLists.txt b/llvm/tools/llvmc/examples/Skeleton/CMakeLists.txt
new file mode 100644
index 00000000000..e1296ca8148
--- /dev/null
+++ b/llvm/tools/llvmc/examples/Skeleton/CMakeLists.txt
@@ -0,0 +1,11 @@
+set(LLVM_TARGET_DEFINITIONS AutoGenerated.td)
+
+tablegen(AutoGenerated.inc -gen-llvmc)
+
+set(LLVM_USED_LIBS CompilerDriver)
+set(LLVM_LINK_COMPONENTS support)
+
+add_llvm_example(llvmc-skeleton
+ Hooks.cpp
+ Main.cpp
+ )
diff --git a/llvm/tools/llvmc/examples/mcc16/CMakeLists.txt b/llvm/tools/llvmc/examples/mcc16/CMakeLists.txt
new file mode 100644
index 00000000000..f9eeb03d41c
--- /dev/null
+++ b/llvm/tools/llvmc/examples/mcc16/CMakeLists.txt
@@ -0,0 +1,11 @@
+set(LLVM_TARGET_DEFINITIONS PIC16.td)
+
+tablegen(PIC16.inc -gen-llvmc)
+
+set(LLVM_USED_LIBS CompilerDriver)
+set(LLVM_LINK_COMPONENTS support)
+
+add_llvm_example(mcc16
+ Hooks.cpp
+ Main.cpp
+ )
diff --git a/llvm/tools/llvmc/src/CMakeLists.txt b/llvm/tools/llvmc/src/CMakeLists.txt
new file mode 100644
index 00000000000..e6c8917748b
--- /dev/null
+++ b/llvm/tools/llvmc/src/CMakeLists.txt
@@ -0,0 +1,19 @@
+set(LLVMGCCCOMMAND llvm-gcc)
+set(LLVMGXXCOMMAND llvm-g++)
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/Base.td.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Base.td
+ @ONLY)
+
+set(LLVM_TARGET_DEFINITIONS AutoGenerated.td)
+
+tablegen(AutoGenerated.inc -gen-llvmc)
+
+set(LLVM_USED_LIBS CompilerDriver)
+set(LLVM_LINK_COMPONENTS support)
+
+add_llvm_tool(llvmc
+ Hooks.cpp
+ Main.cpp
+ )
OpenPOWER on IntegriCloud