summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-11-07 17:40:28 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-11-07 17:40:28 +0000
commit644ae71ae07b9741ac9908912b7b2784b0ab616a (patch)
tree0273454fee35e47e9ff4aca87bb6db3b1b6fa348 /CMakeLists.txt
parent72dab34b83543aebf6661a1c4536ad0806b5b878 (diff)
Add some facilities to work with a git monorepo (experimental setup)
Summary: Some changes are made to cmake, especially the addition of a new LLVM_ENABLE_PROJECTS option that makes the build system aware of the monorepo directory structure. Also a new script is added in llvm/utils/git-svn/. When present in the $PATH, it enables a `git llvm` command. It is providing at this point only the ability to push from the git monorepo: `git llvm push`. It is intended to evolves with more features, for instance I plan on features like `git llvm show r284955` to help working with sequential revision numbers. The push feature is taken from Justin Lebar's script available here: https://github.com/jlebar/llvm-repo-tools/ Reviewers: jlebar Subscribers: mgorny, modocache, llvm-commits Differential Revision: https://reviews.llvm.org/D26334 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a70ebcf4b4d..ab43a4a603d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,6 +93,25 @@ if(CMAKE_HOST_APPLE AND APPLE)
endif()
endif()
+# Git Mono-Repo handling: automatically set the LLVM_EXTERNAL_${project}_SOURCE_DIR
+set(LLVM_ALL_PROJECTS "clang;libcxx;libcxxabi;lldb;compiler-rt;lld;polly")
+set(LLVM_ENABLE_PROJECTS "" CACHE STRING
+ "Semicolon-separated list of projects to build (${LLVM_ALL_PROJECTS}), or \"all\".")
+if( LLVM_ENABLE_PROJECTS STREQUAL "all" )
+ set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS})
+endif()
+foreach(proj ${LLVM_ENABLE_PROJECTS})
+ set(PROJ_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}")
+ if(NOT EXISTS "${PROJ_DIR}" OR NOT IS_DIRECTORY "${PROJ_DIR}")
+ message(FATAL_ERROR "LLVM_ENABLE_PROJECTS requests ${proj} but directory not found: ${PROJ_DIR}")
+ endif()
+ string(TOUPPER "${proj}" upper_proj)
+ set(LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}")
+ if (proj STREQUAL "clang")
+ set(LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../clang-tools-extra")
+ endif()
+endforeach()
+
# The following only works with the Ninja generator in CMake >= 3.0.
set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
"Define the maximum number of concurrent compilation jobs.")