Commit 2257b032 authored by Konstantin Podsvirov's avatar Konstantin Podsvirov

ClangCodeModel: fix link error with MinGW based build

For MinGW clang link library named: liblibclang.dll.a.

Changes:
- improved clang library search algorithm;
- use clang_defines.pri in clangpchmanager.pro.

Task-number: QTCREATORBUG-17680
Change-Id: Ic01fa86238b980991726eeb984ccd82afb333c35
Reviewed-by: Kai Koehne's avatarKai Koehne <kai.koehne@qt.io>
Reviewed-by: Oswald Buddenhagen's avatarOswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Marco Bubke's avatarMarco Bubke <marco.bubke@qt.io>
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 195c7711
include(../../qtcreatorplugin.pri)
include(clangpchmanager-source.pri)
include(../../shared/clang/clang_installation.pri)
DEFINES += CLANG_VERSION=\\\"$${LLVM_VERSION}\\\"
DEFINES += "\"CLANG_RESOURCE_DIR=\\\"$${LLVM_LIBDIR}/clang/$${LLVM_VERSION}/include\\\"\""
include(../../shared/clang/clang_defines.pri)
HEADERS += \
$$PWD/clangpchmanagerplugin.h \
......
......@@ -45,6 +45,10 @@ defineReplace(findClangLibInLibDir) {
} else {
exists ($${libdir}/libclang.*) {
return("-llibclang")
} else {
exists ($${libdir}/liblibclang.dll.a) {
return("-llibclang.dll")
}
}
}
}
......@@ -78,8 +82,11 @@ LLVM_LIBDIR = $$quote($$system($$llvm_config --libdir, lines))
LLVM_INCLUDEPATH = $$system($$llvm_config --includedir, lines)
output = $$system($$llvm_config --version, lines)
LLVM_VERSION = $$extractVersion($$output)
unix:LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --libs, lines)
win32:LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --libnames, lines)
msvc {
LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --libnames, lines)
} else {
LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --libs, lines)
}
LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --system-libs, lines)
LLVM_STATIC_LIBS = $$split(LLVM_STATIC_LIBS_STRING, " ")
......
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