-
Notifications
You must be signed in to change notification settings - Fork 0
/
compiler.pri
70 lines (59 loc) · 1.33 KB
/
compiler.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# Detect best compiler options for current platform
#
FLAGSXX += -std=c++11
USE_CCACHE=FALSE
USE_TRAVIS=$$(TRAVIS)
!isEmpty(USE_TRAVIS) {
QMAKE_CXX=$$(CXX)
QMAKE_CC=$$(CC)
message(Running on travis-ci.org using $$(CXX) and $$(CC))
unix:!macx {
#FLAGSXX += -stdlib=libstdc++
}
macx {
FLAGSXX += -stdlib=libc++
}
} else {
CCACHE=""
COMPXX="g++"
COMP="gcc"
USE_CLANG=FALSE
unix:!macx {
FLAGSXX += -stdlib=libstdc++
system(which ccache):USE_CCACHE=TRUE
system(which clang++):USE_CLANG=TRUE
}
macx {
FLAGSXX += -stdlib=libc++
system(which ccache):USE_CCACHE=TRUE
system(which clang++):USE_CLANG=TRUE
}
contains(USE_CCACHE, TRUE) {
!check {
CCACHE="ccache"
}
}
contains(USE_CLANG, TRUE) {
COMPXX=clang++
COMP=clang
contains(USE_CCACHE, TRUE) {
FLAGSXX += -Qunused-arguments # so clang+ccache works fine without spitting tons of warnings
check {
FLAGSXX += -fsanitize=undefined
}
}
}
QMAKE_CXX="$$CCACHE $$COMPXX"
QMAKE_CC="$$CCACHE $$COMP"
}
#TARGET_EXT = .bc
#QMAKE_EXT_OBJ = .bc
QMAKE_CXXFLAGS += $$FLAGSXX #-emit-llvm
QMAKE_CFLAGS_RELEASE += $$FLAGSXX
#QMAKE_LFLAGS += -stdlib=libc++
#QMAKE_LIB=llvm-ld -link-as-library -o
#QMAKE_RUN_CXX = $(CXX) $(CXXFLAGS) $(INCPATH) -c $src -o $obj
#QMAKE_RUN_CC = $(CC) $(CCFLAGS) $(INCPATH) -c $src -o $obj
#message($$FLAGSXX)
#message($$QMAKE_CXX)