-
Notifications
You must be signed in to change notification settings - Fork 77
/
check-clang.pri
37 lines (31 loc) · 1.39 KB
/
check-clang.pri
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
# Attempt to verify that the CLANG_DIR variable is set and points to a valid
# Clang installation.
#
REQUIRED_CLANG_VERSION = 4.0
equals(CLANG_DIR, "") {
warning("The CLANG_DIR qmake variable is unset.")
warning("Add CLANG_DIR=<path-to-clang-root> to the qmake command-line.")
warning("The provided path should point to a" $$REQUIRED_CLANG_VERSION \
"Clang installation.")
warning("(In the QtCreator IDE, add the setting in the Projects mode.)")
error("check-clang.pri: CLANG_DIR is unset. Aborting.")
}
defineTest(checkClangRequire) {
!exists($$1): error("check-clang.pri: Clang file $${1} does not exist.")
}
# Spot-check to make sure we can find Clang headers and libraries. We do not
# need the clang/clang++ executables, and sometimes they do not exist. (e.g.
# Ubuntu has multiple libllvm-3.X-dev packages, but only a single clang binary
# can exist at once.)
checkClangRequire($${CLANG_DIR}/include/clang/AST/ASTContext.h)
# Check that all expected libraries are present.
CLANG_LIBS = \
clangFrontend clangSerialization clangDriver \
clangTooling clangParse clangSema clangAnalysis \
clangEdit clangAST clangLex clangBasic \
LLVMMC LLVMMCParser LLVMObject LLVMAsmParser LLVMCore LLVMProfileData LLVMSupport \
LLVMOption LLVMBitWriter LLVMBitReader LLVMDemangle
for(CLANG_LIB, CLANG_LIBS) {
checkClangRequire($${CLANG_DIR}/lib/lib$${CLANG_LIB}.a)
}