blob: 9b89d87fc571714bba8539cf2a17c96aee571d5f [file] [log] [blame]
Chris Bieneman580d8152015-07-20 20:36:06 +00001# This file will recurse into all subdirectories that contain CMakeLists.txt
2# Setting variables that match the pattern LLVM_TOOL_{NAME}_BUILD to Off will
3# prevent traversing into a directory.
4#
5# The only tools that need to be explicitly added are ones that have explicit
6# ordering requirements.
7
8# Iterates all the subdirectories to create CMake options to enable/disable
9# traversing each directory.
10create_llvm_tool_options()
Michael J. Spencer93c9b2e2010-09-13 23:59:48 +000011
Sebastian Popa59005b2014-03-14 04:04:14 +000012# Build polly before the tools: the tools link against polly when
13# LINK_POLLY_INTO_TOOLS is set.
14if(WITH_POLLY)
15 add_llvm_external_project(polly)
NAKAMURA Takumie1e52742014-11-10 15:03:02 +000016else()
Chris Bieneman580d8152015-07-20 20:36:06 +000017 set(LLVM_TOOL_POLLY_BUILD Off)
NAKAMURA Takumie1e52742014-11-10 15:03:02 +000018endif()
19
Chris Bieneman580d8152015-07-20 20:36:06 +000020if(NOT LLVM_BUILD_LLVM_DYLIB )
21 set(LLVM_TOOL_LLVM_SHLIB_BUILD Off)
Oscar Fuentesac824ee2011-03-13 03:06:59 +000022endif()
23
Chris Bieneman580d8152015-07-20 20:36:06 +000024if(NOT LLVM_USE_INTEL_JITEVENTS )
25 set(LLVM_TOOL_LLVM_JITLISTENER_BUILD Off)
26endif()
Chandler Carruth3f7b5812011-04-28 08:18:22 +000027
Chris Bieneman3809ca92015-11-10 21:38:58 +000028if(CYGWIN)
Chris Bieneman580d8152015-07-20 20:36:06 +000029 set(LLVM_TOOL_LTO_BUILD Off)
30 set(LLVM_TOOL_LLVM_LTO_BUILD Off)
31endif()
Andy Gibbs3ef5ed12013-06-26 08:05:08 +000032
Chris Bienemand6f5f24a2015-12-16 18:30:36 +000033# Add LTO, llvm-ar, llvm-config, and llvm-profdata before clang, ExternalProject
34# requires targets specified in DEPENDS to exist before the call to
35# ExternalProject_Add.
Chris Bieneman7ad7ae12015-09-10 18:22:33 +000036add_llvm_tool_subdirectory(lto)
Chris Bienemande9588e2015-09-14 18:36:40 +000037add_llvm_tool_subdirectory(llvm-ar)
Chris Bieneman042e8172015-10-02 22:28:48 +000038add_llvm_tool_subdirectory(llvm-config)
Chris Bienemand6f5f24a2015-12-16 18:30:36 +000039add_llvm_tool_subdirectory(llvm-profdata)
Chris Bieneman7ad7ae12015-09-10 18:22:33 +000040
Chris Bieneman19d42692015-07-21 15:53:09 +000041# Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly
42# specified.
43add_llvm_external_project(clang)
44add_llvm_external_project(llgo)
45add_llvm_external_project(lld)
46add_llvm_external_project(lldb)
47
Chris Bieneman69533a52015-06-22 21:58:02 +000048# Automatically add remaining sub-directories containing a 'CMakeLists.txt'
49# file as external projects.
Chris Bieneman580d8152015-07-20 20:36:06 +000050add_llvm_implicit_projects()
Michael J. Spencer93c9b2e2010-09-13 23:59:48 +000051
52set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)