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 )