blob: d3b2fc37af799e777f1a49275369d84990a2b87a [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
11 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libunwind))
Daniel Dunbare0b374b2010-01-22 18:14:27 +000012 add_subdirectory(${entry})
13 endif()
Oscar Fuentesafbe9752009-03-06 01:16:52 +000014 endif()
15endforeach(entry)
Chandler Carruth0c94f5e2012-08-29 00:38:02 +000016
Chandler Carruth408b4fa2013-09-28 18:17:10 +000017# Also add in libc++ and compiler-rt trees if present (and we have
18# a sufficiently recent version of CMake where required).
Alexey Samsonovdb171ea2013-03-05 14:43:07 +000019if(${LLVM_BUILD_RUNTIME})
Chandler Carruth0218fb62013-10-02 06:25:57 +000020 # MSVC isn't quite working with libc++ yet, disable it until issues are
21 # fixed.
22 if(NOT MSVC)
Eric Fiselier8c366882015-03-04 01:16:43 +000023 # libc++ uses the libc++abi target names so libc++abi should be added
24 # first.
Chandler Carruthda490d22014-07-25 10:27:40 +000025 add_llvm_external_project(libcxxabi)
Eric Fiselier8c366882015-03-04 01:16:43 +000026 add_llvm_external_project(libcxx)
Saleem Abdulrasool2ba9a212015-04-25 01:47:39 +000027 add_llvm_external_project(libunwind)
Chandler Carruth0218fb62013-10-02 06:25:57 +000028 endif()
Alexey Samsonovf431a832014-02-27 08:59:01 +000029 if(NOT LLVM_BUILD_EXTERNAL_COMPILER_RT)
30 add_llvm_external_project(compiler-rt)
31 endif()
Chandler Carruth0c94f5e2012-08-29 00:38:02 +000032endif()
NAKAMURA Takumi480132f2014-01-24 12:53:08 +000033
34add_llvm_external_project(dragonegg)