blob: fd761ecfe439905fbed233024e54f163224926e8 [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
NAKAMURA Takumie1e52742014-11-10 15:03:02 +000011if( LLVM_BUILD_LLVM_DYLIB )
12 add_llvm_tool_subdirectory(llvm-shlib)
13else()
14 ignore_llvm_tool_subdirectory(llvm-shlib)
15endif()
16
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000017add_llvm_tool_subdirectory(opt)
18add_llvm_tool_subdirectory(llvm-as)
19add_llvm_tool_subdirectory(llvm-dis)
20add_llvm_tool_subdirectory(llvm-mc)
Oscar Fuentesa229b3c2008-09-22 01:08:49 +000021
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000022add_llvm_tool_subdirectory(llc)
23add_llvm_tool_subdirectory(llvm-ar)
24add_llvm_tool_subdirectory(llvm-nm)
25add_llvm_tool_subdirectory(llvm-size)
Oscar Fuentesa229b3c2008-09-22 01:08:49 +000026
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000027add_llvm_tool_subdirectory(llvm-cov)
Duncan P. N. Exon Smith846a6272014-02-17 23:22:49 +000028add_llvm_tool_subdirectory(llvm-profdata)
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000029add_llvm_tool_subdirectory(llvm-link)
30add_llvm_tool_subdirectory(lli)
Oscar Fuentesa229b3c2008-09-22 01:08:49 +000031
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000032add_llvm_tool_subdirectory(llvm-extract)
33add_llvm_tool_subdirectory(llvm-diff)
34add_llvm_tool_subdirectory(macho-dump)
35add_llvm_tool_subdirectory(llvm-objdump)
36add_llvm_tool_subdirectory(llvm-readobj)
37add_llvm_tool_subdirectory(llvm-rtdyld)
38add_llvm_tool_subdirectory(llvm-dwarfdump)
David Majnemer72ab1a52014-07-24 23:14:40 +000039add_llvm_tool_subdirectory(llvm-vtabledump)
Andrew Kaylor93fe3dc2012-11-21 20:38:26 +000040if( LLVM_USE_INTEL_JITEVENTS )
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000041 add_llvm_tool_subdirectory(llvm-jitlistener)
42else()
43 ignore_llvm_tool_subdirectory(llvm-jitlistener)
Andrew Kaylor93fe3dc2012-11-21 20:38:26 +000044endif( LLVM_USE_INTEL_JITEVENTS )
Oscar Fuentesa229b3c2008-09-22 01:08:49 +000045
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000046add_llvm_tool_subdirectory(bugpoint)
47add_llvm_tool_subdirectory(bugpoint-passes)
48add_llvm_tool_subdirectory(llvm-bcanalyzer)
49add_llvm_tool_subdirectory(llvm-stress)
50add_llvm_tool_subdirectory(llvm-mcmarkup)
Oscar Fuentese638f5d2008-10-26 00:52:09 +000051
Duncan P. N. Exon Smitha12e0232014-07-30 17:11:27 +000052add_llvm_tool_subdirectory(verify-uselistorder)
Duncan P. N. Exon Smith4b4d8ec2014-07-25 17:13:03 +000053
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000054add_llvm_tool_subdirectory(llvm-symbolizer)
Alexander Potapenko8c07f552012-11-12 11:33:29 +000055
NAKAMURA Takumi07a64062013-10-23 17:56:59 +000056add_llvm_tool_subdirectory(llvm-c-test)
Anders Waldenborgb932c662013-10-23 08:10:20 +000057
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000058add_llvm_tool_subdirectory(obj2yaml)
59add_llvm_tool_subdirectory(yaml2obj)
Rafael Espindola87a02902013-04-05 02:57:22 +000060
Peter Collingbourne244ecf52014-10-23 02:33:23 +000061add_llvm_tool_subdirectory(llvm-go)
62
Rafael Espindola3ef98ff2014-06-27 02:51:21 +000063if(NOT CYGWIN AND LLVM_ENABLE_PIC)
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000064 add_llvm_tool_subdirectory(lto)
Peter Collingbourne4e380b02013-09-19 22:15:52 +000065 add_llvm_tool_subdirectory(llvm-lto)
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000066else()
67 ignore_llvm_tool_subdirectory(lto)
Peter Collingbourne4e380b02013-09-19 22:15:52 +000068 ignore_llvm_tool_subdirectory(llvm-lto)
Oscar Fuentesac824ee2011-03-13 03:06:59 +000069endif()
70
Chandler Carruth3f7b5812011-04-28 08:18:22 +000071if( LLVM_ENABLE_PIC )
72 # TODO: support other systems:
Rafael Espindolabd5bd892013-03-17 12:01:05 +000073 if( (CMAKE_SYSTEM_NAME STREQUAL "Linux")
74 OR (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") )
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000075 add_llvm_tool_subdirectory(gold)
76 else()
77 ignore_llvm_tool_subdirectory(gold)
Chandler Carruth3f7b5812011-04-28 08:18:22 +000078 endif()
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000079else()
80 ignore_llvm_tool_subdirectory(gold)
Chandler Carruth3f7b5812011-04-28 08:18:22 +000081endif()
82
Michael J. Spencere734f542012-04-26 19:43:35 +000083add_llvm_external_project(clang)
Andy Gibbs3ef5ed12013-06-26 08:05:08 +000084
85if( NOT LLVM_INCLUDE_TOOLS STREQUAL "bootstrap-only" )
Argyrios Kyrtzidisdba67a22013-08-27 23:27:56 +000086 add_llvm_external_project(lld)
87 add_llvm_external_project(lldb)
Sebastian Pope3cd1422014-03-10 20:47:39 +000088
Argyrios Kyrtzidis7eec9d02013-08-21 19:13:44 +000089 # Automatically add remaining sub-directories containing a 'CMakeLists.txt'
90 # file as external projects.
91 add_llvm_implicit_external_projects()
Andy Gibbs3ef5ed12013-06-26 08:05:08 +000092endif()
Michael J. Spencer93c9b2e2010-09-13 23:59:48 +000093
94set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)