forked from SOUI2/soui.backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.pri
109 lines (92 loc) · 2.01 KB
/
common.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
CONFIG -= qt
CONFIG += stl_off
INCLUDEPATH += $$dir/config
!CONFIG(MBCS){
CharacterSet = 1
}
else{
CharacterSet = 2
DEFINES -= UNICODE
}
CONFIG(debug, debug|release) {
OBJECTS_DIR = $$dir/obj/debug/$$TARGET
DESTDIR = $$dir/bin
CONFIG(x64){
DESTDIR = $$DESTDIR"64"
}
QMAKE_LIBDIR += $$DESTDIR
}
else {
OBJECTS_DIR = $$dir/obj/release/$$TARGET
DESTDIR = $$dir/bin
CONFIG(x64){
DESTDIR = $$DESTDIR"64"
}
QMAKE_LIBDIR += $$DESTDIR
}
#<--下面这段代码为debug和release生成不同的文件名
defineReplace(souiLibraryTarget) {
unset(LIBRARY_NAME)
LIBRARY_NAME = $$1
!debug_and_release|build_pass {
LIBRARY_NAME~= s,64,,
RET = $$LIBRARY_NAME
}
isEmpty(RET):RET = $$LIBRARY_NAME
return($$RET)
}
SAVE_TEMPLATE = $$TEMPLATE
TEMPLATE = fakelib
TARGET = $$qtLibraryTarget($$souiLibraryTarget($$TARGET))
TEMPLATE = $$SAVE_TEMPLATE
#-->
DEFINES += _CRT_SECURE_NO_WARNINGS
#DEFINES += _WIN32_WINNT=0x0502 #会导致vs2013编译skia失败,还是删掉吧。
#多核编译
QMAKE_CXXFLAGS += /MP
CONFIG(x64){
QMAKE_LFLAGS += /MACHINE:X64
DEFINES -= WIN32
DEFINES += _WIN64
}
else{
QMAKE_LFLAGS += /MACHINE:X86
}
!CONFIG(USING_CLR){
#关闭RTTI
QMAKE_CXXFLAGS_RTTI_ON += /GR-
}
else{
QMAKE_CXXFLAGS += /clr
CONFIG += exceptions_off
#关闭异常
QMAKE_CXXFLAGS -= -EHsc
}
QMAKE_CXXFLAGS += -Fd$(IntDir)
!CONFIG(DISABLE_WCHAR){
#打开wchar_t为内置类型
QMAKE_CXXFLAGS += /Zc:wchar_t
}
QMAKE_CXXFLAGS_RELEASE += /O1
QMAKE_CXXFLAGS_RELEASE += /Zi
CONFIG(CAN_DEBUG){
#Release版本允许生产调试符号
QMAKE_LFLAGS_RELEASE += /DEBUG
QMAKE_LFLAGS_RELEASE += /OPT:REF /OPT:ICF
}
CONFIG(USING_MT){
#使用MT链接CRT
QMAKE_CXXFLAGS_RELEASE += /MT
QMAKE_CXXFLAGS_DEBUG += /MTd
}
CONFIG(USING_CLR){
#使用MD链接CRT
QMAKE_CXXFLAGS_RELEASE -= /MT
QMAKE_CXXFLAGS_DEBUG -= /MTd
QMAKE_CXXFLAGS_RELEASE += /MD
QMAKE_CXXFLAGS_DEBUG += /MDd
}
CONFIG(TOOLSET_XP){
QMAKE_TARGET_OS=xp
}
QMAKE_CXXFLAGS += /wd4100 /wd4101 /wd4102 /wd4189 /wd4996