From ee3ea72e3c976fa70aad6dfcce194afed528a969 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sat, 11 Aug 2012 18:59:54 -0700 Subject: [PATCH] Not parsing llvm cmake when using external clang This speeds up the cmake project regeneration. --- cpp/CMakeLists.txt | 5 ++++- cpp/ycm/CMakeLists.txt | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 5e916c97..d8e23c85 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -70,6 +70,9 @@ else() "Your C++ compiler does NOT support C++11, compiling in C++03 mode." ) endif() -add_subdirectory( llvm ) +if ( NOT EXTERNAL_LIBCLANG_PATH AND NOT USE_SYSTEM_LIBCLANG ) + add_subdirectory( llvm ) +endif() + add_subdirectory( BoostParts ) add_subdirectory( ycm ) diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt index aadab9ff..153702f7 100644 --- a/cpp/ycm/CMakeLists.txt +++ b/cpp/ycm/CMakeLists.txt @@ -33,8 +33,10 @@ include_directories( SYSTEM ${BoostParts_SOURCE_DIR} ${PYTHON_INCLUDE_DIRS} - "${LLVM_SOURCE_DIR}/include" - "${LLVM_SOURCE_DIR}/tools/clang/include" + # We need CMAKE_SOURCE_DIR here instead of LLVM_SOURCE_DIR because the llvm + # subdir may not have been included in the build + "${CMAKE_SOURCE_DIR}/llvm/include" + "${CMAKE_SOURCE_DIR}/llvm/tools/clang/include" ) file( GLOB_RECURSE SOURCES *.h *.cpp )