[CMake] Automatically pick up subdirectories in llvm/tools as 'external projects...
[oota-llvm.git] / tools / CMakeLists.txt
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.
4
5 if( NOT WIN32 OR MSYS OR CYGWIN )
6   # We currently require 'sed' to build llvm-config, so don't try to build it
7   # on pure Win32.
8   add_llvm_tool_subdirectory(llvm-config)
9 else()
10   ignore_llvm_tool_subdirectory(llvm-config)
11 endif()
12
13 add_llvm_tool_subdirectory(opt)
14 add_llvm_tool_subdirectory(llvm-as)
15 add_llvm_tool_subdirectory(llvm-dis)
16 add_llvm_tool_subdirectory(llvm-mc)
17
18 add_llvm_tool_subdirectory(llc)
19 add_llvm_tool_subdirectory(llvm-ar)
20 add_llvm_tool_subdirectory(llvm-nm)
21 add_llvm_tool_subdirectory(llvm-size)
22
23 add_llvm_tool_subdirectory(llvm-cov)
24 add_llvm_tool_subdirectory(llvm-prof)
25 add_llvm_tool_subdirectory(llvm-link)
26 add_llvm_tool_subdirectory(lli)
27
28 add_llvm_tool_subdirectory(llvm-extract)
29 add_llvm_tool_subdirectory(llvm-diff)
30 add_llvm_tool_subdirectory(macho-dump)
31 add_llvm_tool_subdirectory(llvm-objdump)
32 add_llvm_tool_subdirectory(llvm-readobj)
33 add_llvm_tool_subdirectory(llvm-rtdyld)
34 add_llvm_tool_subdirectory(llvm-dwarfdump)
35 if( LLVM_USE_INTEL_JITEVENTS )
36   add_llvm_tool_subdirectory(llvm-jitlistener)
37 else()
38   ignore_llvm_tool_subdirectory(llvm-jitlistener)
39 endif( LLVM_USE_INTEL_JITEVENTS )
40
41 add_llvm_tool_subdirectory(bugpoint)
42 add_llvm_tool_subdirectory(bugpoint-passes)
43 add_llvm_tool_subdirectory(llvm-bcanalyzer)
44 add_llvm_tool_subdirectory(llvm-stress)
45 add_llvm_tool_subdirectory(llvm-mcmarkup)
46
47 add_llvm_tool_subdirectory(llvm-symbolizer)
48
49 add_llvm_tool_subdirectory(obj2yaml)
50 add_llvm_tool_subdirectory(yaml2obj)
51
52 if( NOT WIN32 )
53   add_llvm_tool_subdirectory(lto)
54 else()
55   ignore_llvm_tool_subdirectory(lto)
56 endif()
57
58 if( LLVM_ENABLE_PIC )
59   # TODO: support other systems:
60   if( (CMAKE_SYSTEM_NAME STREQUAL "Linux")
61       OR (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") )
62     add_llvm_tool_subdirectory(gold)
63   else()
64     ignore_llvm_tool_subdirectory(gold)
65   endif()
66 else()
67   ignore_llvm_tool_subdirectory(gold)
68 endif()
69
70 add_llvm_external_project(clang)
71
72 if( NOT LLVM_INCLUDE_TOOLS STREQUAL "bootstrap-only" )
73   # Automatically add remaining sub-directories containing a 'CMakeLists.txt'
74   # file as external projects.
75   add_llvm_implicit_external_projects()
76 endif()
77
78 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)