-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
47 lines (39 loc) · 1.37 KB
/
Copy pathxmake.lua
File metadata and controls
47 lines (39 loc) · 1.37 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
46
47
add_rules("mode.release")
if is_plat("windows") then
local msvcRuntime = is_mode("debug") and "MTd" or "MT"
set_runtimes(msvcRuntime)
end
-- requires
add_requires("sqlite3",{version = "3-3.53.0+0"}, {configs = {shared = false}, system = false})
add_requires("cjson",{configs = {shared = false}})
add_requires("klib",{version = "2024.06.03"}, {configs = {shared = false}})
set_warnings("all", "extra")
target("llsql")
set_languages("c17")
set_kind("binary")
add_files("llsql/**.c")
add_headerfiles("llsql/**.h")
add_includedirs(".", {public = true})
set_targetdir(path.join("$(builddir)",""))
-- packages
add_packages( "cjson","sqlite3","klib",
{public = true}
)
-- platform defines
if is_plat("linux") then
add_defines("LLSQL_LINUX", "_GNU_SOURCE", {public = true})
add_cxxflags("-frtti", "-fexceptions")
elseif is_plat("windows") then
add_defines("LLSQL_WINDOWS", {public = true})
elseif is_plat("macosx") then
add_defines("LLSQL_MACOS", {public = true})
end
-- mode defines
if is_mode("debug") then
add_defines("LLSQL_DEBUG", {public = true})
elseif is_mode("release") then
add_defines("LLSQL_RELEASE", {public = true})
if not is_plat("macosx") then
set_policy("build.optimization.lto", true)
end
end