Chris Bieneman | 580d815 | 2015-07-20 20:36:06 +0000 | [diff] [blame] | 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() |
Michael J. Spencer | 93c9b2e | 2010-09-13 23:59:48 +0000 | [diff] [blame] | 11 | |
Sebastian Pop | a59005b | 2014-03-14 04:04:14 +0000 | [diff] [blame] | 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) |
NAKAMURA Takumi | e1e5274 | 2014-11-10 15:03:02 +0000 | [diff] [blame] | 16 | else() |
Chris Bieneman | 580d815 | 2015-07-20 20:36:06 +0000 | [diff] [blame] | 17 | set(LLVM_TOOL_POLLY_BUILD Off) |
NAKAMURA Takumi | e1e5274 | 2014-11-10 15:03:02 +0000 | [diff] [blame] | 18 | endif() |
| 19 | |
Chris Bieneman | 580d815 | 2015-07-20 20:36:06 +0000 | [diff] [blame] | 20 | if(NOT LLVM_BUILD_LLVM_DYLIB ) |
| 21 | set(LLVM_TOOL_LLVM_SHLIB_BUILD Off) |
Oscar Fuentes | ac824ee | 2011-03-13 03:06:59 +0000 | [diff] [blame] | 22 | endif() |
| 23 | |
Chris Bieneman | 580d815 | 2015-07-20 20:36:06 +0000 | [diff] [blame] | 24 | if(NOT LLVM_USE_INTEL_JITEVENTS ) |
| 25 | set(LLVM_TOOL_LLVM_JITLISTENER_BUILD Off) |
| 26 | endif() |
Chandler Carruth | 3f7b581 | 2011-04-28 08:18:22 +0000 | [diff] [blame] | 27 | |
Hans Wennborg | f6892eda | 2016-02-12 19:02:39 +0000 | [diff] [blame] | 28 | if(CYGWIN OR NOT LLVM_ENABLE_PIC) |
Chris Bieneman | 580d815 | 2015-07-20 20:36:06 +0000 | [diff] [blame] | 29 | set(LLVM_TOOL_LTO_BUILD Off) |
| 30 | set(LLVM_TOOL_LLVM_LTO_BUILD Off) |
| 31 | endif() |
Andy Gibbs | 3ef5ed1 | 2013-06-26 08:05:08 +0000 | [diff] [blame] | 32 | |
Chris Bieneman | d6f5f24a | 2015-12-16 18:30:36 +0000 | [diff] [blame] | 33 | # 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 Bieneman | 7ad7ae1 | 2015-09-10 18:22:33 +0000 | [diff] [blame] | 36 | add_llvm_tool_subdirectory(lto) |
Chris Bieneman | e50f744 | 2016-02-26 21:07:04 +0000 | [diff] [blame] | 37 | add_llvm_tool_subdirectory(gold) |
Chris Bieneman | de9588e | 2015-09-14 18:36:40 +0000 | [diff] [blame] | 38 | add_llvm_tool_subdirectory(llvm-ar) |
Chris Bieneman | 042e817 | 2015-10-02 22:28:48 +0000 | [diff] [blame] | 39 | add_llvm_tool_subdirectory(llvm-config) |
Chris Bieneman | d6f5f24a | 2015-12-16 18:30:36 +0000 | [diff] [blame] | 40 | add_llvm_tool_subdirectory(llvm-profdata) |
Chris Bieneman | 7ad7ae1 | 2015-09-10 18:22:33 +0000 | [diff] [blame] | 41 | |
Chris Bieneman | 19d4269 | 2015-07-21 15:53:09 +0000 | [diff] [blame] | 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 | |
Chris Bieneman | 69533a5 | 2015-06-22 21:58:02 +0000 | [diff] [blame] | 49 | # Automatically add remaining sub-directories containing a 'CMakeLists.txt' |
| 50 | # file as external projects. |
Chris Bieneman | 580d815 | 2015-07-20 20:36:06 +0000 | [diff] [blame] | 51 | add_llvm_implicit_projects() |
Michael J. Spencer | 93c9b2e | 2010-09-13 23:59:48 +0000 | [diff] [blame] | 52 | |
| 53 | set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE) |