[CMake] Fixing a problem with external projects that aren't getting enabled properly.

This should address PR 24194, and some builedbot failures.

llvm-svn: 242746
This commit is contained in:
Chris Bieneman 2015-07-21 00:39:53 +00:00
parent fbecf1ab1a
commit 95ba62c91a
1 changed files with 4 additions and 0 deletions

View File

@ -694,6 +694,10 @@ macro(add_llvm_external_project name)
set(add_llvm_external_dir ${name})
endif()
canonicalize_tool_name(${name} nameUPPER)
if(NOT DEFINED LLVM_TOOL_${projectName}_BUILD)
option(LLVM_TOOL_${name}_BUILD
"Whether to build ${name} as part of LLVM" On)
endif()
if (LLVM_TOOL_${nameUPPER}_BUILD)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}/CMakeLists.txt)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir} ${add_llvm_external_dir})