-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathxmake.lua
93 lines (79 loc) · 2.49 KB
/
xmake.lua
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
set_version ("17.11.0")
-- mode
set_allowedmodes("releasedbg", "release", "debug", "profile")
add_rules("mode.releasedbg", "mode.release", "mode.debug", "mode.profile")
-- plat
set_allowedplats("linux", "macosx", "windows")
-- proj
set_project("Goldfish Scheme")
-- repo
add_repositories("goldfish-repo xmake")
option("tbox")
set_description("Use tbox installed via apt")
set_default(false)
set_values(false, true)
option_end()
local S7_VERSION = "20241230"
add_requires("s7 "..S7_VERSION, {system=false})
local TBOX_VERSION = "1.7.6"
if has_config("tbox") then
add_requires("apt::libtbox-dev", {alias="tbox"})
else
tbox_configs = {hash=true, ["force-utf8"]=true}
add_requires("tbox " .. TBOX_VERSION, {system=false, configs=tbox_configs})
end
option("http")
set_description("Enable http")
set_default(false)
set_values(false, true)
option_end()
if has_config("http") then
add_requires("cpr 1.10.5")
end
target ("goldfish") do
set_languages("c++98")
if is_plat("linux") then
-- for Ubuntu 20.04
add_syslinks("stdc++")
end
set_targetdir("$(projectdir)/bin/")
add_files ("src/goldfish.cpp")
add_packages("s7")
add_packages("tbox")
add_installfiles("$(projectdir)/goldfish/(scheme/*.scm)", {prefixdir = "share/goldfish"})
add_installfiles("$(projectdir)/goldfish/(srfi/*.scm)", {prefixdir = "share/goldfish"})
add_installfiles("$(projectdir)/goldfish/(liii/*.scm)", {prefixdir = "share/goldfish"})
end
target ("http") do
set_languages("c++17")
if is_plat("linux") then
-- for Ubuntu 20.04
add_syslinks("stdc++")
end
set_targetdir("$(projectdir)/bin/")
add_includedirs("src/")
add_files ("http/src/http.cpp")
add_packages("s7")
add_packages("tbox")
add_packages("cpr")
end
includes("@builtin/xpack")
xpack ("goldfish")
set_formats("deb", "rpm", "srpm")
set_author("Da Shen <[email protected]>")
set_license("Apache-2.0")
set_title("Goldfish Scheme")
set_description("A Python-like Scheme Interpreter")
set_homepage("https://gitee.com/LiiiLabs/goldfish")
add_targets ("goldfish")
add_sourcefiles("(xmake/**)")
add_sourcefiles("xmake.lua")
add_sourcefiles("(src/**)")
add_sourcefiles("(goldfish/**)")
on_load(function (package)
if package:with_source() then
package:set("basename", "goldfish-$(plat)-src-v$(version)")
else
package:set("basename", "goldfish-$(plat)-$(arch)-v$(version)")
end
end)