blob: 3c679b82d3b4fa0e2962baf403f7ffca46c38da0 [file] [log] [blame]
Michael J. Spencer92e1deb2011-01-20 06:39:06 +00001# 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 Fuentes3d01fc72008-09-22 01:08:49 +00004
Tobias Grosserbaaadb22010-10-30 00:54:26 +00005# If polly exists and is not disabled compile it and add it to the LLVM tools.
6option(LLVM_BUILD_POLLY "Compile polly" ON)
7if( 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)
11endif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/polly/CMakeLists.txt )
12
Michael J. Spencer3a210e22010-09-13 23:59:48 +000013if( NOT WIN32 OR MSYS OR CYGWIN )
14 # It is useful to build llvm-config before the other tools, so we
15 # have a fresh LibDeps.txt for regenerating the hard-coded library
16 # dependencies. llvm-config/CMakeLists.txt takes care of this but we
17 # must keep llvm-config as the first entry on the list of tools to
18 # be built.
19 add_subdirectory(llvm-config)
20endif()
21
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000022add_subdirectory(opt)
23add_subdirectory(llvm-as)
24add_subdirectory(llvm-dis)
Chris Lattnerf9f065e2009-06-18 23:04:45 +000025add_subdirectory(llvm-mc)
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000026
27add_subdirectory(llc)
28add_subdirectory(llvm-ranlib)
29add_subdirectory(llvm-ar)
30add_subdirectory(llvm-nm)
Michael J. Spencer32a12ba2011-09-28 20:57:46 +000031add_subdirectory(llvm-size)
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000032
33add_subdirectory(llvm-ld)
34add_subdirectory(llvm-prof)
35add_subdirectory(llvm-link)
36add_subdirectory(lli)
37
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000038add_subdirectory(llvm-extract)
John McCallb82b4332010-08-24 09:16:51 +000039add_subdirectory(llvm-diff)
Daniel Dunbar75373ac2010-11-27 05:58:44 +000040add_subdirectory(macho-dump)
Michael J. Spencer92e1deb2011-01-20 06:39:06 +000041add_subdirectory(llvm-objdump)
Jim Grosbach1cb19a42011-03-18 17:11:39 +000042add_subdirectory(llvm-rtdyld)
Benjamin Kramer72c0d7f2011-09-13 19:42:23 +000043add_subdirectory(llvm-dwarfdump)
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000044
45add_subdirectory(bugpoint)
Rafael Espindola6b018372010-08-08 00:50:57 +000046add_subdirectory(bugpoint-passes)
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000047add_subdirectory(llvm-bcanalyzer)
48add_subdirectory(llvm-stub)
Ted Kremenek0a6f0532010-04-13 20:52:50 +000049add_subdirectory(edis)
Oscar Fuentes48ed0f52008-10-26 00:52:09 +000050
Oscar Fuentes98f6ddc2011-03-13 03:06:59 +000051if( NOT WIN32 )
52 add_subdirectory(lto)
53endif()
54
Chandler Carruthd7797492011-04-28 08:18:22 +000055if( LLVM_ENABLE_PIC )
56 # TODO: support other systems:
57 if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
58 add_subdirectory(gold)
59 endif()
60endif()
61
NAKAMURA Takumi40250612011-10-16 02:54:33 +000062set(LLVM_CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/clang" CACHE PATH "Path to Clang source directory")
63
64if (NOT ${LLVM_CLANG_SOURCE_DIR} STREQUAL ""
65 AND EXISTS ${LLVM_CLANG_SOURCE_DIR}/CMakeLists.txt)
Douglas Gregore6964362011-07-14 23:49:55 +000066 option(LLVM_BUILD_CLANG "Whether to build Clang as part of LLVM" ON)
67 if (${LLVM_BUILD_CLANG})
68 add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/clang )
69 endif()
NAKAMURA Takumi40250612011-10-16 02:54:33 +000070endif ()
Michael J. Spencer3a210e22010-09-13 23:59:48 +000071
72set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)