Oscar Fuentes | afbe975 | 2009-03-06 01:16:52 +0000 | [diff] [blame] | 1 | # Discover the projects that use CMake in the subdirectories. |
| 2 | # Note that explicit cmake invocation is required every time a new project is |
| 3 | # added or removed. |
| 4 | file(GLOB entries *) |
| 5 | foreach(entry ${entries}) |
| 6 | if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt) |
Chandler Carruth | 276abc5 | 2012-06-27 00:30:08 +0000 | [diff] [blame] | 7 | if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND |
NAKAMURA Takumi | 480132f | 2014-01-24 12:53:08 +0000 | [diff] [blame] | 8 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND |
Chandler Carruth | da490d2 | 2014-07-25 10:27:40 +0000 | [diff] [blame] | 9 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND |
Saleem Abdulrasool | 2ba9a21 | 2015-04-25 01:47:39 +0000 | [diff] [blame] | 10 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxxabi) AND |
Chris Bieneman | ca1d220 | 2015-10-28 18:36:56 +0000 | [diff] [blame] | 11 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libunwind) AND |
Justin Lebar | b1ad4e2 | 2016-09-09 21:34:12 +0000 | [diff] [blame] | 12 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/test-suite) AND |
Don Hinton | 49777fa | 2017-12-12 17:06:08 +0000 | [diff] [blame] | 13 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/openmp) AND |
Michael Kruse | b55f751 | 2025-02-16 15:39:52 +0100 | [diff] [blame] | 14 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/cross-project-tests) AND |
| 15 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/flang-rt)) |
Shoaib Meenai | ef76577 | 2018-12-04 00:12:03 +0000 | [diff] [blame] | 16 | get_filename_component(entry_name "${entry}" NAME) |
| 17 | add_llvm_external_project(${entry_name}) |
Daniel Dunbar | e0b374b | 2010-01-22 18:14:27 +0000 | [diff] [blame] | 18 | endif() |
Oscar Fuentes | afbe975 | 2009-03-06 01:16:52 +0000 | [diff] [blame] | 19 | endif() |
| 20 | endforeach(entry) |
Chandler Carruth | 0c94f5e | 2012-08-29 00:38:02 +0000 | [diff] [blame] | 21 | |
Chandler Carruth | 408b4fa | 2013-09-28 18:17:10 +0000 | [diff] [blame] | 22 | # Also add in libc++ and compiler-rt trees if present (and we have |
| 23 | # a sufficiently recent version of CMake where required). |
Alexey Samsonov | db171ea | 2013-03-05 14:43:07 +0000 | [diff] [blame] | 24 | if(${LLVM_BUILD_RUNTIME}) |
Chandler Carruth | 0218fb6 | 2013-10-02 06:25:57 +0000 | [diff] [blame] | 25 | # MSVC isn't quite working with libc++ yet, disable it until issues are |
| 26 | # fixed. |
Eric Fiselier | a0c06c3 | 2017-05-11 01:44:30 +0000 | [diff] [blame] | 27 | # FIXME: LLVM_FORCE_BUILD_RUNTIME is currently used by libc++ to force |
| 28 | # enable the in-tree build when targeting clang-cl. |
| 29 | if(NOT MSVC OR LLVM_FORCE_BUILD_RUNTIME) |
Eric Fiselier | 0d42e15 | 2016-10-09 20:38:29 +0000 | [diff] [blame] | 30 | # Add the projects in reverse order of their dependencies so that the |
| 31 | # dependent projects can see the target names of their dependencies. |
| 32 | add_llvm_external_project(libunwind) |
Louis Dionne | a3c83b7 | 2019-07-19 18:52:46 +0000 | [diff] [blame] | 33 | add_llvm_external_project(pstl) |
Siva Chandra | 4380647 | 2019-10-04 17:30:54 +0000 | [diff] [blame] | 34 | add_llvm_external_project(libc) |
Louis Dionne | 0a06eb9 | 2019-08-05 18:29:14 +0000 | [diff] [blame] | 35 | add_llvm_external_project(libcxxabi) |
Eric Fiselier | 8c36688 | 2015-03-04 01:16:43 +0000 | [diff] [blame] | 36 | add_llvm_external_project(libcxx) |
Chandler Carruth | 0218fb6 | 2013-10-02 06:25:57 +0000 | [diff] [blame] | 37 | endif() |
Alexey Samsonov | f431a83 | 2014-02-27 08:59:01 +0000 | [diff] [blame] | 38 | if(NOT LLVM_BUILD_EXTERNAL_COMPILER_RT) |
| 39 | add_llvm_external_project(compiler-rt) |
| 40 | endif() |
Michael Kruse | b55f751 | 2025-02-16 15:39:52 +0100 | [diff] [blame] | 41 | add_llvm_external_project(flang-rt) |
Chandler Carruth | 0c94f5e | 2012-08-29 00:38:02 +0000 | [diff] [blame] | 42 | endif() |
NAKAMURA Takumi | 480132f | 2014-01-24 12:53:08 +0000 | [diff] [blame] | 43 | |
| 44 | add_llvm_external_project(dragonegg) |
Pirama Arumuga Nainar | 70a3671 | 2017-03-07 18:54:17 +0000 | [diff] [blame] | 45 | add_llvm_external_project(openmp) |
Don Hinton | 49777fa | 2017-12-12 17:06:08 +0000 | [diff] [blame] | 46 | |
| 47 | if(LLVM_INCLUDE_TESTS) |
James Henderson | 1364750 | 2021-02-08 15:40:55 +0000 | [diff] [blame] | 48 | add_llvm_external_project(cross-project-tests) |
Don Hinton | 49777fa | 2017-12-12 17:06:08 +0000 | [diff] [blame] | 49 | endif() |