forked from OSchip/llvm-project
CMake: Introduce LLVM_CLANG_SOURCE_DIR, "tools/clang" by default. Clang will not be built if LLVM_CLANG_SOURCE_DIR="" or ${LLVM_CLANG_SOURCE_DIR}/CMakeLists.txt is not found.
llvm-svn: 142103
This commit is contained in:
parent
914f1924e0
commit
bccadaf1a3
|
@ -351,6 +351,11 @@
|
|||
Function Interface library. If the library or its headers are
|
||||
installed on a custom location, you can set the variables
|
||||
FFI_INCLUDE_DIR and FFI_LIBRARY_DIR. Defaults to OFF.</dd>
|
||||
|
||||
<dt><b>LLVM_CLANG_SOURCE_DIR</b>:PATH</dt>
|
||||
<dd>Path to Clang's source directory. Defaults to tools/clang.
|
||||
Clang will not be built when it is empty or it does not point valid
|
||||
path.</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -59,11 +59,14 @@ if( LLVM_ENABLE_PIC )
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt )
|
||||
set(LLVM_CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/clang" CACHE PATH "Path to Clang source directory")
|
||||
|
||||
if (NOT ${LLVM_CLANG_SOURCE_DIR} STREQUAL ""
|
||||
AND EXISTS ${LLVM_CLANG_SOURCE_DIR}/CMakeLists.txt)
|
||||
option(LLVM_BUILD_CLANG "Whether to build Clang as part of LLVM" ON)
|
||||
if (${LLVM_BUILD_CLANG})
|
||||
add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/clang )
|
||||
endif()
|
||||
endif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt )
|
||||
endif ()
|
||||
|
||||
set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)
|
||||
|
|
Loading…
Reference in New Issue