Repository navigation
Expand file tree
/
Copy pathlua.pri
More file actions
45 lines (39 loc) · 1.7 KB
/
Copy pathlua.pri
File metadata and controls
45 lines (39 loc) · 1.7 KB
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
# Lua dependency for Lua4RS and the standalone JSON API runner.
#
# Supported versions: 5.4 and 5.5 (both provide _ENV, which the sandbox needs).
# Default: 5.4 if available, otherwise 5.5.
#
# qmake LUA_VERSION=5.5 pick a version explicitly
# qmake LUA_PKGCONFIG=<name> use a specific pkg-config package as is
#
# Windows: set LUA_LIBS / LUA_INCLUDEPATH (default -llua from the toolchain).
win32 {
isEmpty(LUA_LIBS): LUA_LIBS = -llua
LIBS += $$LUA_LIBS
INCLUDEPATH += $$LUA_INCLUDEPATH
} else {
CONFIG += link_pkgconfig
isEmpty(LUA_PKGCONFIG) {
isEmpty(LUA_VERSION): LUA_CANDIDATES = 5.4 5.5
else: LUA_CANDIDATES = $$LUA_VERSION
for(ver, LUA_CANDIDATES) {
!equals(ver, 5.4):!equals(ver, 5.5): \
error("Unsupported LUA_VERSION=$$ver (supported: 5.4, 5.5)")
# Package names differ between distributions:
# lua5.4 (Debian/Ubuntu/Arch), lua54 (Fedora/Arch),
# lua-5.4 (FreeBSD), lua (whatever the default Lua is).
ver_short = $$replace(ver, \\., )
for(pkg, $$list(lua$$ver lua$$ver_short lua-$$ver lua)) {
isEmpty(LUA_PKGCONFIG) {
pkg_ver = $$system(pkg-config --modversion $$pkg 2>/dev/null)
!isEmpty(pkg_ver):versionAtLeast(pkg_ver, $${ver}.0):versionAtMost(pkg_ver, $${ver}.99) {
LUA_PKGCONFIG = $$pkg
message("Lua4RS: using Lua $$pkg_ver (pkg-config: $$pkg)")
}
}
}
}
isEmpty(LUA_PKGCONFIG): error("No Lua $$join(LUA_CANDIDATES, " or ") found via pkg-config")
}
PKGCONFIG *= $$LUA_PKGCONFIG
}