1 # 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.
5 # The only tools that need to be explicitly added are ones that have explicit
6 # ordering requirements.
8 # Iterates all the subdirectories to create CMake options to enable/disable
9 # traversing each directory.
10 create_llvm_tool_options()
12 # Build polly before the tools: the tools link against polly when
13 # LINK_POLLY_INTO_TOOLS is set.
15 add_llvm_external_project(polly)
17 set(LLVM_TOOL_POLLY_BUILD Off)
20 if(NOT LLVM_BUILD_LLVM_DYLIB )
21 set(LLVM_TOOL_LLVM_SHLIB_BUILD Off)
24 if(NOT LLVM_USE_INTEL_JITEVENTS )
25 set(LLVM_TOOL_LLVM_JITLISTENER_BUILD Off)
29 set(LLVM_TOOL_LTO_BUILD Off)
30 set(LLVM_TOOL_LLVM_LTO_BUILD Off)
33 # Add LTO, llvm-ar, and llvm-config before clang, ExternalProject requires
34 # targets specified in DEPENDS to exist before the call to ExternalProject_Add.
35 add_llvm_tool_subdirectory(lto)
36 add_llvm_tool_subdirectory(llvm-ar)
37 add_llvm_tool_subdirectory(llvm-config)
39 # Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly
41 add_llvm_external_project(clang)
42 add_llvm_external_project(llgo)
43 add_llvm_external_project(lld)
44 add_llvm_external_project(lldb)
46 # Automatically add remaining sub-directories containing a 'CMakeLists.txt'
47 # file as external projects.
48 add_llvm_implicit_projects()
50 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)