Commit 164b72b2 authored by Nikolai Kosjar's avatar Nikolai Kosjar

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: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent e873f872
......@@ -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)
......
......@@ -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")
......
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment