[llvm] r271440 - Add new LLVM_EXTERNAL_PROJECTS option to cmake

Tamas Berghammer via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 16:00:46 PDT 2016


Author: tberghammer
Date: Wed Jun  1 18:00:45 2016
New Revision: 271440

URL: http://llvm.org/viewvc/llvm-project?rev=271440&view=rev
Log:
Add new LLVM_EXTERNAL_PROJECTS option to cmake

The new option makes it possible to build external projects as part of
the llvm build without copying (or symlinking) then into llvm/tool with
specifying a few additional cmake variables.

Example usage (2 additional project called foo and bar):
-DLLVM_EXTERNAL_PROJECTS="Foo;Bar"
-DLLVM_EXTERNAL_FOO_SOURCE_DIR=/src/foo
-DLLVM_EXTERNAL_BAR_SOURCE_DIR=/src/bar

Note: This is the extension of the approach we already support for
clang/lldb/poly with adding an option to specify additional supported
projects.

Differential revision: http://reviews.llvm.org/D20838

Modified:
    llvm/trunk/docs/CMake.rst
    llvm/trunk/tools/CMakeLists.txt

Modified: llvm/trunk/docs/CMake.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.rst?rev=271440&r1=271439&r2=271440&view=diff
==============================================================================
--- llvm/trunk/docs/CMake.rst (original)
+++ llvm/trunk/docs/CMake.rst Wed Jun  1 18:00:45 2016
@@ -339,6 +339,14 @@ LLVM-specific variables
   will not be used.  If the variable for an external project does not point
   to a valid path, then that project will not be built.
 
+**LLVM_EXTERNAL_PROJECTS**:STRING
+  Semicolon-separated list of additional external projects to build as part of
+  llvm. For each project LLVM_EXTERNAL_<NAME>_SOURCE_DIR have to be specified
+  with the path for the source code of the project. Example:
+  ``-DLLVM_EXTERNAL_PROJECTS="Foo;Bar"
+    -DLLVM_EXTERNAL_FOO_SOURCE_DIR=/src/foo
+    -DLLVM_EXTERNAL_BAR_SOURCE_DIR=/src/bar``.
+
 **LLVM_USE_OPROFILE**:BOOL
   Enable building OProfile JIT support. Defaults to OFF.
 

Modified: llvm/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/CMakeLists.txt?rev=271440&r1=271439&r2=271440&view=diff
==============================================================================
--- llvm/trunk/tools/CMakeLists.txt (original)
+++ llvm/trunk/tools/CMakeLists.txt Wed Jun  1 18:00:45 2016
@@ -50,4 +50,9 @@ add_llvm_external_project(lldb)
 # file as external projects.
 add_llvm_implicit_projects()
 
+# Add subprojects specified using LLVM_EXTERNAL_PROJECTS
+foreach(p ${LLVM_EXTERNAL_PROJECTS})
+  add_llvm_external_project(${p})
+endforeach(p)
+
 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)




More information about the llvm-commits mailing list