forked from DarkFlippers/qFlipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qflipper_common.pri
50 lines (38 loc) · 1.21 KB
/
qflipper_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
NAME = qFlipper
equals(QT_MAJOR_VERSION, 6): QT += core5compat
unix:!macx {
DEFINES += USB_BACKEND_LIBUSB
CONFIG += link_pkgconfig
PKGCONFIG += libusb-1.0 zlib
isEmpty(PREFIX): PREFIX = /usr
} else:win32 {
CONFIG -= debug_and_release
DEFINES += USB_BACKEND_WIN32
INCLUDEPATH += $$[QT_INSTALL_HEADERS]/QtZlib
!win32-g++: LIBS += -lSetupApi -lWinusb -lUser32
else: LIBS += -lsetupapi -lwinusb
} else:macx {
DEFINES += USB_BACKEND_LIBUSB
PKG_CONFIG = /opt/homebrew/bin/pkg-config
CONFIG += link_pkgconfig
PKGCONFIG += libusb-1.0 zlib
} else {
error("Unsupported OS or compiler")
}
GIT_VERSION = $$system("git describe --tags --abbrev=0","lines", HAS_VERSION)
!equals(HAS_VERSION, 0) {
GIT_VERSION = unknown
}
GIT_COMMIT = $$system("git rev-parse --short=8 HEAD","lines", HAS_COMMIT)
!equals(HAS_COMMIT, 0) {
GIT_COMMIT = unknown
}
GIT_TIMESTAMP = $$system("git log -1 --pretty=format:%ct","lines", HAS_TIMESTAMP)
!equals(HAS_TIMESTAMP, 0) {
GIT_TIMESTAMP = 0
}
DEFINES += APP_NAME=\\\"$$NAME\\\" \
APP_VERSION=\\\"$$GIT_VERSION\\\" \
APP_COMMIT=\\\"$$GIT_COMMIT\\\" \
APP_TIMESTAMP=$$GIT_TIMESTAMP \
PB_ENABLE_MALLOC