150
|
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.
|
|
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.
|
|
10 create_llvm_tool_options()
|
|
11
|
|
12 if(NOT LLVM_BUILD_LLVM_DYLIB AND NOT LLVM_BUILD_LLVM_C_DYLIB)
|
|
13 set(LLVM_TOOL_LLVM_SHLIB_BUILD Off)
|
|
14 endif()
|
|
15
|
|
16 if(NOT LLVM_USE_INTEL_JITEVENTS )
|
|
17 set(LLVM_TOOL_LLVM_JITLISTENER_BUILD Off)
|
|
18 endif()
|
|
19
|
|
20 if(CYGWIN OR NOT LLVM_ENABLE_PIC)
|
|
21 set(LLVM_TOOL_LTO_BUILD Off)
|
|
22 endif()
|
|
23
|
|
24 # Add LTO, llvm-ar, llvm-config, and llvm-profdata before clang, ExternalProject
|
|
25 # requires targets specified in DEPENDS to exist before the call to
|
|
26 # ExternalProject_Add.
|
|
27 add_llvm_tool_subdirectory(lto)
|
|
28 add_llvm_tool_subdirectory(gold)
|
|
29 add_llvm_tool_subdirectory(llvm-ar)
|
|
30 add_llvm_tool_subdirectory(llvm-config)
|
|
31 add_llvm_tool_subdirectory(llvm-lto)
|
|
32 add_llvm_tool_subdirectory(llvm-profdata)
|
|
33
|
|
34 # Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly
|
|
35 # specified.
|
|
36 add_llvm_external_project(clang)
|
|
37 add_llvm_external_project(lld)
|
|
38 add_llvm_external_project(lldb)
|
|
39 add_llvm_external_project(mlir)
|
173
|
40 # Flang depends on mlir, so place it afterward
|
|
41 add_llvm_external_project(flang)
|
150
|
42
|
|
43 # Automatically add remaining sub-directories containing a 'CMakeLists.txt'
|
|
44 # file as external projects.
|
|
45 add_llvm_implicit_projects()
|
|
46
|
|
47 add_llvm_external_project(polly)
|
|
48
|
|
49 # Add subprojects specified using LLVM_EXTERNAL_PROJECTS
|
|
50 foreach(p ${LLVM_EXTERNAL_PROJECTS})
|
|
51 add_llvm_external_project(${p})
|
|
52 endforeach(p)
|
|
53
|
|
54 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)
|