• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4file(GLOB entries *)
5foreach(entry ${entries})
6  if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt)
7    if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND
8       (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND
9       (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND
10       (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxxabi) AND
11       (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libunwind) AND
12       (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/test-suite) AND
13       (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/parallel-libs) AND
14       (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/openmp) AND
15       (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests))
16      add_subdirectory(${entry})
17    endif()
18  endif()
19endforeach(entry)
20
21# Also add in libc++ and compiler-rt trees if present (and we have
22# a sufficiently recent version of CMake where required).
23if(${LLVM_BUILD_RUNTIME})
24  # MSVC isn't quite working with libc++ yet, disable it until issues are
25  # fixed.
26  # FIXME: LLVM_FORCE_BUILD_RUNTIME is currently used by libc++ to force
27  # enable the in-tree build when targeting clang-cl.
28  if(NOT MSVC OR LLVM_FORCE_BUILD_RUNTIME)
29    # Add the projects in reverse order of their dependencies so that the
30    # dependent projects can see the target names of their dependencies.
31    add_llvm_external_project(libunwind)
32    add_llvm_external_project(libcxxabi)
33    add_llvm_external_project(libcxx)
34  endif()
35  if(NOT LLVM_BUILD_EXTERNAL_COMPILER_RT)
36    add_llvm_external_project(compiler-rt)
37  endif()
38endif()
39
40add_llvm_external_project(dragonegg)
41add_llvm_external_project(parallel-libs)
42add_llvm_external_project(openmp)
43
44if(LLVM_INCLUDE_TESTS)
45  add_llvm_external_project(debuginfo-tests)
46endif()
47