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 | |
Chris Bieneman | 580d815 | 2015-07-20 20:36:06 +0000 | [diff] [blame] | 28 | if(CYGWIN OR NOT LLVM_ENABLE_PIC) |
| 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 | de9588e | 2015-09-14 18:36:40 +0000 | [diff] [blame^] | 33 | # Add LTO and llvm-ar before clang, ExternalProject requires targets specified |
| 34 | # in DEPENDS to exist before the call to ExternalProject_Add. |
Chris Bieneman | 7ad7ae1 | 2015-09-10 18:22:33 +0000 | [diff] [blame] | 35 | add_llvm_tool_subdirectory(lto) |
Chris Bieneman | de9588e | 2015-09-14 18:36:40 +0000 | [diff] [blame^] | 36 | add_llvm_tool_subdirectory(llvm-ar) |
Chris Bieneman | 7ad7ae1 | 2015-09-10 18:22:33 +0000 | [diff] [blame] | 37 | |
Chris Bieneman | 19d4269 | 2015-07-21 15:53:09 +0000 | [diff] [blame] | 38 | # Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly |
| 39 | # specified. |
| 40 | add_llvm_external_project(clang) |
| 41 | add_llvm_external_project(llgo) |
| 42 | add_llvm_external_project(lld) |
| 43 | add_llvm_external_project(lldb) |
| 44 | |
Chris Bieneman | 69533a5 | 2015-06-22 21:58:02 +0000 | [diff] [blame] | 45 | # Automatically add remaining sub-directories containing a 'CMakeLists.txt' |
| 46 | # file as external projects. |
Chris Bieneman | 580d815 | 2015-07-20 20:36:06 +0000 | [diff] [blame] | 47 | add_llvm_implicit_projects() |
Michael J. Spencer | 93c9b2e | 2010-09-13 23:59:48 +0000 | [diff] [blame] | 48 | |
| 49 | set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE) |