blob: acc4eb12860ee07ab0f4da7b89fcf84eba73325a [file] [log] [blame]
Hans Wennborgfe06e812013-08-23 17:59:13 +00001add_llvm_tool_subdirectory(llvm-config)
Michael J. Spencer93c9b2e2010-09-13 23:59:48 +00002
Sebastian Popa59005b2014-03-14 04:04:14 +00003# Build polly before the tools: the tools link against polly when
4# LINK_POLLY_INTO_TOOLS is set.
5if(WITH_POLLY)
6 add_llvm_external_project(polly)
7else(WITH_POLLY)
8 list(APPEND LLVM_IMPLICIT_PROJECT_IGNORE "${LLVM_MAIN_SRC_DIR}/tools/polly")
9endif(WITH_POLLY)
10
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000011add_llvm_tool_subdirectory(opt)
12add_llvm_tool_subdirectory(llvm-as)
13add_llvm_tool_subdirectory(llvm-dis)
14add_llvm_tool_subdirectory(llvm-mc)
Oscar Fuentesa229b3c2008-09-22 01:08:49 +000015
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000016add_llvm_tool_subdirectory(llc)
17add_llvm_tool_subdirectory(llvm-ar)
18add_llvm_tool_subdirectory(llvm-nm)
19add_llvm_tool_subdirectory(llvm-size)
Oscar Fuentesa229b3c2008-09-22 01:08:49 +000020
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000021add_llvm_tool_subdirectory(llvm-cov)
Duncan P. N. Exon Smith846a6272014-02-17 23:22:49 +000022add_llvm_tool_subdirectory(llvm-profdata)
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000023add_llvm_tool_subdirectory(llvm-link)
24add_llvm_tool_subdirectory(lli)
Oscar Fuentesa229b3c2008-09-22 01:08:49 +000025
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000026add_llvm_tool_subdirectory(llvm-extract)
27add_llvm_tool_subdirectory(llvm-diff)
28add_llvm_tool_subdirectory(macho-dump)
29add_llvm_tool_subdirectory(llvm-objdump)
30add_llvm_tool_subdirectory(llvm-readobj)
31add_llvm_tool_subdirectory(llvm-rtdyld)
32add_llvm_tool_subdirectory(llvm-dwarfdump)
David Majnemer72ab1a52014-07-24 23:14:40 +000033add_llvm_tool_subdirectory(llvm-vtabledump)
Andrew Kaylor93fe3dc2012-11-21 20:38:26 +000034if( LLVM_USE_INTEL_JITEVENTS )
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000035 add_llvm_tool_subdirectory(llvm-jitlistener)
36else()
37 ignore_llvm_tool_subdirectory(llvm-jitlistener)
Andrew Kaylor93fe3dc2012-11-21 20:38:26 +000038endif( LLVM_USE_INTEL_JITEVENTS )
Oscar Fuentesa229b3c2008-09-22 01:08:49 +000039
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000040add_llvm_tool_subdirectory(bugpoint)
41add_llvm_tool_subdirectory(bugpoint-passes)
42add_llvm_tool_subdirectory(llvm-bcanalyzer)
43add_llvm_tool_subdirectory(llvm-stress)
44add_llvm_tool_subdirectory(llvm-mcmarkup)
Oscar Fuentese638f5d2008-10-26 00:52:09 +000045
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000046add_llvm_tool_subdirectory(llvm-symbolizer)
Alexander Potapenko8c07f552012-11-12 11:33:29 +000047
NAKAMURA Takumi07a64062013-10-23 17:56:59 +000048add_llvm_tool_subdirectory(llvm-c-test)
Anders Waldenborgb932c662013-10-23 08:10:20 +000049
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000050add_llvm_tool_subdirectory(obj2yaml)
51add_llvm_tool_subdirectory(yaml2obj)
Rafael Espindola87a02902013-04-05 02:57:22 +000052
Rafael Espindola3ef98ff2014-06-27 02:51:21 +000053if(NOT CYGWIN AND LLVM_ENABLE_PIC)
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000054 add_llvm_tool_subdirectory(lto)
Peter Collingbourne4e380b02013-09-19 22:15:52 +000055 add_llvm_tool_subdirectory(llvm-lto)
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000056else()
57 ignore_llvm_tool_subdirectory(lto)
Peter Collingbourne4e380b02013-09-19 22:15:52 +000058 ignore_llvm_tool_subdirectory(llvm-lto)
Oscar Fuentesac824ee2011-03-13 03:06:59 +000059endif()
60
Chandler Carruth3f7b5812011-04-28 08:18:22 +000061if( LLVM_ENABLE_PIC )
62 # TODO: support other systems:
Rafael Espindolabd5bd892013-03-17 12:01:05 +000063 if( (CMAKE_SYSTEM_NAME STREQUAL "Linux")
64 OR (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") )
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000065 add_llvm_tool_subdirectory(gold)
66 else()
67 ignore_llvm_tool_subdirectory(gold)
Chandler Carruth3f7b5812011-04-28 08:18:22 +000068 endif()
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000069else()
70 ignore_llvm_tool_subdirectory(gold)
Chandler Carruth3f7b5812011-04-28 08:18:22 +000071endif()
72
Michael J. Spencere734f542012-04-26 19:43:35 +000073add_llvm_external_project(clang)
Andy Gibbs3ef5ed12013-06-26 08:05:08 +000074
75if( NOT LLVM_INCLUDE_TOOLS STREQUAL "bootstrap-only" )
Argyrios Kyrtzidisdba67a22013-08-27 23:27:56 +000076 add_llvm_external_project(lld)
77 add_llvm_external_project(lldb)
Sebastian Pope3cd1422014-03-10 20:47:39 +000078
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000079 # Automatically add remaining sub-directories containing a 'CMakeLists.txt'
80 # file as external projects.
81 add_llvm_implicit_external_projects()
Andy Gibbs3ef5ed12013-06-26 08:05:08 +000082endif()
Michael J. Spencer93c9b2e2010-09-13 23:59:48 +000083
84set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)