blob: 2122665c0dc4bbbac7bd22669c7adf9f9012f7af [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
13 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/parallel-libs))
Daniel Dunbare0b374b2010-01-22 18:14:27 +000014 add_subdirectory(${entry})
15 endif()
Oscar Fuentesafbe9752009-03-06 01:16:52 +000016 endif()
17endforeach(entry)
Chandler Carruth0c94f5e2012-08-29 00:38:02 +000018
Chandler Carruth408b4fa2013-09-28 18:17:10 +000019# Also add in libc++ and compiler-rt trees if present (and we have
20# a sufficiently recent version of CMake where required).
Alexey Samsonovdb171ea2013-03-05 14:43:07 +000021if(${LLVM_BUILD_RUNTIME})
Chandler Carruth0218fb62013-10-02 06:25:57 +000022 # MSVC isn't quite working with libc++ yet, disable it until issues are
23 # fixed.
24 if(NOT MSVC)
Eric Fiselier0d42e152016-10-09 20:38:29 +000025 # Add the projects in reverse order of their dependencies so that the
26 # dependent projects can see the target names of their dependencies.
27 add_llvm_external_project(libunwind)
Chandler Carruthda490d22014-07-25 10:27:40 +000028 add_llvm_external_project(libcxxabi)
Eric Fiselier8c366882015-03-04 01:16:43 +000029 add_llvm_external_project(libcxx)
Chandler Carruth0218fb62013-10-02 06:25:57 +000030 endif()
Alexey Samsonovf431a832014-02-27 08:59:01 +000031 if(NOT LLVM_BUILD_EXTERNAL_COMPILER_RT)
32 add_llvm_external_project(compiler-rt)
33 endif()
Chandler Carruth0c94f5e2012-08-29 00:38:02 +000034endif()
NAKAMURA Takumi480132f2014-01-24 12:53:08 +000035
36add_llvm_external_project(dragonegg)
Justin Lebarb1ad4e22016-09-09 21:34:12 +000037add_llvm_external_project(parallel-libs)