Not using the system libclang by default

We used to do this but it was unsafe, as issue #167 proves. YCM has to give
libclang an include to YCM's copy of clang system headers (again, see issue #167
for details) and those headers may not be valid for a newer libclang.

If the user really wants to user the system libclang, then he can just always
call cmake himself. The installation guide in the README goes to great lengths
to explain the simple process of building YCM "by hand".

Fixes #167.
This commit is contained in:
Strahinja Val Markovic 2013-03-01 18:03:28 -08:00
parent 67bf88b726
commit 9e0318d229

View File

@ -33,22 +33,8 @@ option( PATH_TO_LLVM_ROOT "Path to the root of a LLVM+Clang binary distribution"
option( USE_SYSTEM_LIBCLANG "Set to ON to use the system libclang library" OFF )
option( EXTERNAL_LIBCLANG_PATH "Path libclang library to use" )
# Checks for clang 3.2 (LLVM 4.2+)
if ( USE_CLANG_COMPLETER AND NOT USE_SYSTEM_LIBCLANG AND NOT PATH_TO_LLVM_ROOT )
# Figure out Clang version
if ( COMPILER_IS_CLANG )
set( CLANG_VERSION ${CMAKE_CXX_COMPILER_VERSION} )
else()
execute_process( COMMAND clang -dumpversion OUTPUT_VARIABLE CLANG_VERSION )
endif()
if ( CLANG_VERSION VERSION_EQUAL 4.2 OR CLANG_VERSION VERSION_GREATER 4.2 )
# Good enough, use it.
set( USE_SYSTEM_LIBCLANG ON )
message( "System libclang seems good enough, using it." )
else()
# If the wrong version, or not found, download
message( "Downloading Clang 3.2 (system libclang not present or not good enough)" )
message( "Downloading Clang 3.2" )
set( CLANG_URL "http://llvm.org/releases/3.2" )
@ -77,7 +63,6 @@ if ( USE_CLANG_COMPLETER AND NOT USE_SYSTEM_LIBCLANG AND NOT PATH_TO_LLVM_ROOT )
# And set PATH_TO_LLVM_ROOT
set( PATH_TO_LLVM_ROOT "${CMAKE_CURRENT_BINARY_DIR}/../${CLANG_DIRNAME}" )
endif()
endif()
if ( PATH_TO_LLVM_ROOT OR USE_SYSTEM_LIBCLANG OR EXTERNAL_LIBCLANG_PATH )
set( USE_CLANG_COMPLETER TRUE )