OSDN Git Service

llvm-objcopy: silence warning introduced in r364296
[android-x86/external-llvm.git] / tools / CMakeLists.txt
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 # Build polly before the tools: the tools link against polly when
13 # LINK_POLLY_INTO_TOOLS is set.
14 if(WITH_POLLY)
15   add_llvm_external_project(polly)
16 else()
17   set(LLVM_TOOL_POLLY_BUILD Off)
18 endif()
19
20 if(NOT LLVM_BUILD_LLVM_DYLIB AND NOT LLVM_BUILD_LLVM_C_DYLIB)
21   set(LLVM_TOOL_LLVM_SHLIB_BUILD Off)
22 endif()
23
24 if(NOT LLVM_USE_INTEL_JITEVENTS )
25   set(LLVM_TOOL_LLVM_JITLISTENER_BUILD Off)
26 endif()
27
28 if(CYGWIN OR NOT LLVM_ENABLE_PIC)
29   set(LLVM_TOOL_LTO_BUILD Off)
30 endif()
31
32 # Add LTO, llvm-ar, llvm-config, and llvm-profdata before clang, ExternalProject
33 # requires targets specified in DEPENDS to exist before the call to
34 # ExternalProject_Add.
35 add_llvm_tool_subdirectory(lto)
36 add_llvm_tool_subdirectory(gold)
37 add_llvm_tool_subdirectory(llvm-ar)
38 add_llvm_tool_subdirectory(llvm-config)
39 add_llvm_tool_subdirectory(llvm-lto)
40 add_llvm_tool_subdirectory(llvm-profdata)
41
42 # Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly
43 # specified.
44 add_llvm_external_project(clang)
45 add_llvm_external_project(llgo)
46 add_llvm_external_project(lld)
47 add_llvm_external_project(lldb)
48
49 # Automatically add remaining sub-directories containing a 'CMakeLists.txt'
50 # file as external projects.
51 add_llvm_implicit_projects()
52
53 # Add subprojects specified using LLVM_EXTERNAL_PROJECTS
54 foreach(p ${LLVM_EXTERNAL_PROJECTS})
55   add_llvm_external_project(${p})
56 endforeach(p)
57
58 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)