blob: f254cf10806d75bb3896fb76a5902a329a0f3a46 [file] [log] [blame]
Oscar Fuentesafbe9752009-03-06 01:16:52 +00001# 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.
4file(GLOB entries *)
5foreach(entry ${entries})
6 if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt)
Chandler Carruth276abc52012-06-27 00:30:08 +00007 if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND
NAKAMURA Takumi480132f2014-01-24 12:53:08 +00008 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND
Chandler Carruthda490d22014-07-25 10:27:40 +00009 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND
Saleem Abdulrasool2ba9a212015-04-25 01:47:39 +000010 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxxabi) AND
Chris Bienemanca1d2202015-10-28 18:36:56 +000011 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libunwind) AND
Justin Lebarb1ad4e22016-09-09 21:34:12 +000012 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/test-suite) AND
Don Hinton49777fa2017-12-12 17:06:08 +000013 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/openmp) AND
Michael Kruseb55f7512025-02-16 15:39:52 +010014 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/cross-project-tests) AND
15 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/flang-rt))
Shoaib Meenaief765772018-12-04 00:12:03 +000016 get_filename_component(entry_name "${entry}" NAME)
17 add_llvm_external_project(${entry_name})
Daniel Dunbare0b374b2010-01-22 18:14:27 +000018 endif()
Oscar Fuentesafbe9752009-03-06 01:16:52 +000019 endif()
20endforeach(entry)
Chandler Carruth0c94f5e2012-08-29 00:38:02 +000021
Chandler Carruth408b4fa2013-09-28 18:17:10 +000022# Also add in libc++ and compiler-rt trees if present (and we have
23# a sufficiently recent version of CMake where required).
Alexey Samsonovdb171ea2013-03-05 14:43:07 +000024if(${LLVM_BUILD_RUNTIME})
Chandler Carruth0218fb62013-10-02 06:25:57 +000025 # MSVC isn't quite working with libc++ yet, disable it until issues are
26 # fixed.
Eric Fiseliera0c06c32017-05-11 01:44:30 +000027 # 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 Fiselier0d42e152016-10-09 20:38:29 +000030 # 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 Dionnea3c83b72019-07-19 18:52:46 +000033 add_llvm_external_project(pstl)
Siva Chandra43806472019-10-04 17:30:54 +000034 add_llvm_external_project(libc)
Louis Dionne0a06eb92019-08-05 18:29:14 +000035 add_llvm_external_project(libcxxabi)
Eric Fiselier8c366882015-03-04 01:16:43 +000036 add_llvm_external_project(libcxx)
Chandler Carruth0218fb62013-10-02 06:25:57 +000037 endif()
Alexey Samsonovf431a832014-02-27 08:59:01 +000038 if(NOT LLVM_BUILD_EXTERNAL_COMPILER_RT)
39 add_llvm_external_project(compiler-rt)
40 endif()
Michael Kruseb55f7512025-02-16 15:39:52 +010041 add_llvm_external_project(flang-rt)
Chandler Carruth0c94f5e2012-08-29 00:38:02 +000042endif()
NAKAMURA Takumi480132f2014-01-24 12:53:08 +000043
44add_llvm_external_project(dragonegg)
Pirama Arumuga Nainar70a36712017-03-07 18:54:17 +000045add_llvm_external_project(openmp)
Don Hinton49777fa2017-12-12 17:06:08 +000046
47if(LLVM_INCLUDE_TESTS)
James Henderson13647502021-02-08 15:40:55 +000048 add_llvm_external_project(cross-project-tests)
Don Hinton49777fa2017-12-12 17:06:08 +000049endif()