Files
qt-creator/tests/unit/unittest/clang_dependency.pri
Ulf Hermann 5e0639542f Add some sanity to the clang detection code for qmake build
llvm-config can usually be found in PATH on systems which have standard
paths at all. There is no need to specify LLVM_INSTALL_DIR then.
Furthermore, llvm-config has an option --bindir which will tell us the
directory where clang can be found (if installed). No need to apply
strange heuristics based on LLVM_INSTALL_DIR. Finally, we can check
within each .pro file for the conditions to be met using qmake's
require() function. This way we don't need to fiddle with
LLVM_INSTALL_DIR in unrelated places.

Change-Id: I1a6ab092b06de40dfbfa4a9e7053451360fd24c8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-22 08:47:05 +00:00

27 lines
852 B
Plaintext

include(../../../src/shared/clang/clang_installation.pri)
!isEmpty(LLVM_VERSION) {
requires(!isEmpty(LIBCLANG_LIBS))
equals(LLVM_IS_COMPILED_WITH_RTTI, "NO") : message("LLVM needs to be compiled with RTTI!")
requires(equals(LLVM_IS_COMPILED_WITH_RTTI, "YES"))
DEFINES += CLANG_UNIT_TESTS
INCLUDEPATH += $$LLVM_INCLUDEPATH
win32 {
LIBS += -lVersion
# set run path for clang.dll dependency
bin_path = $$LLVM_BINDIR
bin_path ~= s,/,\\,g
# the below gets added to later by testcase.prf
check.commands = cd . & set PATH=$$bin_path;%PATH%& cmd /c
}
LIBS += $$LIBTOOLING_LIBS $$LIBCLANG_LIBS
QMAKE_RPATHDIR += $$LLVM_LIBDIR
LLVM_CXXFLAGS ~= s,-g\d?,
QMAKE_CXXFLAGS += $$LLVM_CXXFLAGS
DEFINES += CLANG_COMPILER_PATH=\"R\\\"xxx($$LLVM_BINDIR/clang)xxx\\\"\"
}