Clang: fix llvm lib linking on windows

If we use paths with spaces we cannot split them anymore so we have to
handle unix and windows differently.

Change-Id: Ibfc8c51cfe2ecd68e913ad84e0e1269eb7eeda02
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2016-09-19 17:25:25 +02:00
committed by Tim Jenssen
parent 47c01daeb2
commit 381bee1434
2 changed files with 4 additions and 2 deletions

View File

@@ -73,11 +73,12 @@ win32: BIN_EXTENSION = .exe
llvm_config = $$system_quote($$LLVM_INSTALL_DIR/bin/llvm-config)
requires(exists($$llvm_config$$BIN_EXTENSION))
#message("llvm-config found, querying it for paths and version")
LLVM_LIBDIR = $$system($$llvm_config --libdir, lines)
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)
LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --libs, lines)
unix:LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --libs, lines)
win32:LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --libnames, lines)
LLVM_STATIC_LIBS_STRING += $$system($$llvm_config --system-libs, lines)
LLVM_STATIC_LIBS = $$split(LLVM_STATIC_LIBS_STRING, " ")

View File

@@ -8,5 +8,6 @@ requires(equals(LLVM_IS_COMPILED_WITH_RTTI, "YES"))
DEFINES += CLANG_UNIT_TESTS
INCLUDEPATH += $$LLVM_INCLUDEPATH
win32:LIBS += -lVersion
LIBS += $$LIBTOOLING_LIBS $$LIBCLANG_LIBS
}