Michael J. Spencer | 2670c25 | 2011-01-20 06:39:06 +0000 | [diff] [blame] | 1 | # NOTE: The tools are organized into groups of four consisting of one large and |
| 2 | # three small executables. This is done to minimize memory load in parallel |
| 3 | # builds. Please retain this ordering. |
Oscar Fuentes | a229b3c | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 4 | |
Tobias Grosser | ea9dca4 | 2010-10-30 00:54:26 +0000 | [diff] [blame] | 5 | # If polly exists and is not disabled compile it and add it to the LLVM tools. |
| 6 | option(LLVM_BUILD_POLLY "Compile polly" ON) |
| 7 | if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/polly/CMakeLists.txt ) |
| 8 | if (LLVM_BUILD_POLLY) |
| 9 | add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/polly) |
| 10 | endif (LLVM_BUILD_POLLY) |
| 11 | endif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/polly/CMakeLists.txt ) |
| 12 | |
Michael J. Spencer | 93c9b2e | 2010-09-13 23:59:48 +0000 | [diff] [blame] | 13 | if( NOT WIN32 OR MSYS OR CYGWIN ) |
Daniel Dunbar | ab0ad4e | 2011-12-01 20:18:09 +0000 | [diff] [blame^] | 14 | # We currently require 'sed' to build llvm-config, so don't try to build it |
Duncan Sands | b8e6cee | 2011-12-01 10:50:19 +0000 | [diff] [blame] | 15 | # on pure Win32. |
Daniel Dunbar | ab0ad4e | 2011-12-01 20:18:09 +0000 | [diff] [blame^] | 16 | add_subdirectory(llvm-config) |
Michael J. Spencer | 93c9b2e | 2010-09-13 23:59:48 +0000 | [diff] [blame] | 17 | endif() |
| 18 | |
Oscar Fuentes | a229b3c | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 19 | add_subdirectory(opt) |
| 20 | add_subdirectory(llvm-as) |
| 21 | add_subdirectory(llvm-dis) |
Chris Lattner | 8dd8a52 | 2009-06-18 23:04:45 +0000 | [diff] [blame] | 22 | add_subdirectory(llvm-mc) |
Oscar Fuentes | a229b3c | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 23 | |
| 24 | add_subdirectory(llc) |
| 25 | add_subdirectory(llvm-ranlib) |
| 26 | add_subdirectory(llvm-ar) |
| 27 | add_subdirectory(llvm-nm) |
Michael J. Spencer | c4ad466 | 2011-09-28 20:57:46 +0000 | [diff] [blame] | 28 | add_subdirectory(llvm-size) |
Oscar Fuentes | a229b3c | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 29 | |
| 30 | add_subdirectory(llvm-ld) |
| 31 | add_subdirectory(llvm-prof) |
| 32 | add_subdirectory(llvm-link) |
| 33 | add_subdirectory(lli) |
| 34 | |
Oscar Fuentes | a229b3c | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 35 | add_subdirectory(llvm-extract) |
John McCall | 5ee026c | 2010-08-24 09:16:51 +0000 | [diff] [blame] | 36 | add_subdirectory(llvm-diff) |
Daniel Dunbar | fdfb635 | 2010-11-27 05:58:44 +0000 | [diff] [blame] | 37 | add_subdirectory(macho-dump) |
Michael J. Spencer | 2670c25 | 2011-01-20 06:39:06 +0000 | [diff] [blame] | 38 | add_subdirectory(llvm-objdump) |
Jim Grosbach | 0072cdb | 2011-03-18 17:11:39 +0000 | [diff] [blame] | 39 | add_subdirectory(llvm-rtdyld) |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 40 | add_subdirectory(llvm-dwarfdump) |
Oscar Fuentes | a229b3c | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 41 | |
| 42 | add_subdirectory(bugpoint) |
Rafael Espindola | 414de85 | 2010-08-08 00:50:57 +0000 | [diff] [blame] | 43 | add_subdirectory(bugpoint-passes) |
Oscar Fuentes | a229b3c | 2008-09-22 01:08:49 +0000 | [diff] [blame] | 44 | add_subdirectory(llvm-bcanalyzer) |
| 45 | add_subdirectory(llvm-stub) |
Oscar Fuentes | e638f5d | 2008-10-26 00:52:09 +0000 | [diff] [blame] | 46 | |
Oscar Fuentes | ac824ee | 2011-03-13 03:06:59 +0000 | [diff] [blame] | 47 | if( NOT WIN32 ) |
| 48 | add_subdirectory(lto) |
| 49 | endif() |
| 50 | |
Chandler Carruth | 3f7b581 | 2011-04-28 08:18:22 +0000 | [diff] [blame] | 51 | if( LLVM_ENABLE_PIC ) |
| 52 | # TODO: support other systems: |
| 53 | if( CMAKE_SYSTEM_NAME STREQUAL "Linux" ) |
| 54 | add_subdirectory(gold) |
| 55 | endif() |
| 56 | endif() |
| 57 | |
NAKAMURA Takumi | bccadaf | 2011-10-16 02:54:33 +0000 | [diff] [blame] | 58 | set(LLVM_CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/clang" CACHE PATH "Path to Clang source directory") |
| 59 | |
| 60 | if (NOT ${LLVM_CLANG_SOURCE_DIR} STREQUAL "" |
| 61 | AND EXISTS ${LLVM_CLANG_SOURCE_DIR}/CMakeLists.txt) |
Douglas Gregor | 82432f7 | 2011-07-14 23:49:55 +0000 | [diff] [blame] | 62 | option(LLVM_BUILD_CLANG "Whether to build Clang as part of LLVM" ON) |
| 63 | if (${LLVM_BUILD_CLANG}) |
NAKAMURA Takumi | 46282e4 | 2011-10-16 11:50:37 +0000 | [diff] [blame] | 64 | add_subdirectory(${LLVM_CLANG_SOURCE_DIR} clang) |
Douglas Gregor | 82432f7 | 2011-07-14 23:49:55 +0000 | [diff] [blame] | 65 | endif() |
NAKAMURA Takumi | bccadaf | 2011-10-16 02:54:33 +0000 | [diff] [blame] | 66 | endif () |
Michael J. Spencer | 93c9b2e | 2010-09-13 23:59:48 +0000 | [diff] [blame] | 67 | |
| 68 | set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE) |