diff options
author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-09-04 10:21:41 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-09-04 08:59:51 +0000 |
commit | 164b72b22a4968c1c0894d40edb365cd45fb4eda (patch) | |
tree | 5c46211384052f282fb5468a1bbd00f8d09f4b2a /src | |
parent | e873f872ef2a2ba1342dd013ab2e184e6676a71a (diff) | |
download | qt-creator-164b72b22a4968c1c0894d40edb365cd45fb4eda.tar.gz |
Clang: Check for libclang main header file
Otherwise we will run into compile errors if the libclang dev package is
not installed.
Change-Id: I31c05d9d0e11154f1c3748e6736c143805d310e8
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/clangcodemodel/clangcodemodel.qbs | 2 | ||||
-rw-r--r-- | src/shared/clang/clang_installation.pri | 3 | ||||
-rw-r--r-- | src/tools/clangbackend/clangbackend.qbs | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/clangcodemodel/clangcodemodel.qbs b/src/plugins/clangcodemodel/clangcodemodel.qbs index cc41d8ebd2..ca81f76fa8 100644 --- a/src/plugins/clangcodemodel/clangcodemodel.qbs +++ b/src/plugins/clangcodemodel/clangcodemodel.qbs @@ -30,7 +30,7 @@ QtcPlugin { property string llvmLibs: Clang.libraries(qbs.targetOS) property string llvmVersion: Clang.version(llvmConfig, QtcProcessOutputReader) - condition: llvmConfig + condition: llvmConfig && File.exists(llvmIncludeDir.concat("/clang-c/Index.h")) cpp.includePaths: base.concat(llvmIncludeDir) cpp.libraryPaths: base.concat(llvmLibDir) diff --git a/src/shared/clang/clang_installation.pri b/src/shared/clang/clang_installation.pri index 7ce74635ee..6e0ced06e8 100644 --- a/src/shared/clang/clang_installation.pri +++ b/src/shared/clang/clang_installation.pri @@ -87,7 +87,8 @@ unix { LLVM_VERSION = $$findLLVMVersionFromLibDir($$LLVM_LIBDIR) } - !exists($$LLVM_INCLUDEPATH): error("Cannot detect include dir for clang, candidate: $$LLVM_INCLUDEPATH") + LIBCLANG_MAIN_HEADER = $$LLVM_INCLUDEPATH/clang-c/Index.h + !exists($$LIBCLANG_MAIN_HEADER): error("Cannot find libclang's main header file, candidate: $$LIBCLANG_MAIN_HEADER") !exists($$LLVM_LIBDIR): error("Cannot detect lib dir for clang, candidate: $$LLVM_LIBDIR") clang_lib = $$findClangLibInLibDir($$LLVM_LIBDIR) isEmpty(clang_lib): error("Cannot find Clang shared library in $$LLVM_LIBDIR") diff --git a/src/tools/clangbackend/clangbackend.qbs b/src/tools/clangbackend/clangbackend.qbs index c46534240d..16b0f948e6 100644 --- a/src/tools/clangbackend/clangbackend.qbs +++ b/src/tools/clangbackend/clangbackend.qbs @@ -1,4 +1,5 @@ import qbs 1.0 +import qbs.File import QtcClangInstallation as Clang import QtcFunctions import QtcProcessOutputReader @@ -23,7 +24,7 @@ QtcTool { property string llvmLibDir: Clang.libDir(llvmConfig, QtcProcessOutputReader) property string llvmLibs: Clang.libraries(qbs.targetOS) - condition: llvmConfig + condition: llvmConfig && File.exists(llvmIncludeDir.concat("/clang-c/Index.h")) cpp.includePaths: base.concat(["ipcsource", llvmIncludeDir]) cpp.libraryPaths: base.concat(llvmLibDir) |