-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
85 lines (71 loc) · 1.47 KB
/
Copy pathxmake.lua
File metadata and controls
85 lines (71 loc) · 1.47 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
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
--- @diagnostic disable: undefined-global
local src_root = "app/src/jni"
local arch = "arm64-v8a"
local sdk = os.getenv("ANDROID_HOME")
if is_arch("armeabi-v7a") then
arch = "armeabi-v7a"
end
local sdl_root = sdk .. "/lib/SDL3/" .. arch
set_project("learn-gles")
set_version("1.0.0")
add_rules("mode.debug", "mode.release")
set_allowedplats("android")
set_allowedarchs({"armeabi-v7a", "arm64-v8a"})
set_defaultplat("android")
set_defaultarchs("arm64-v8a")
set_defaultmode("debug")
set_kind("shared")
set_languages("cxx17")
set_warnings("allextra", "pedantic")
add_cxxflags({
"-fno-rtti",
"-fno-exceptions"
})
add_shflags({
"-Wl,--as-needed",
"-Wl,--no-undefined",
})
add_sysincludedirs({
"third_party/include",
sdk .. "/include"
})
add_linkdirs({
sdl_root
})
target("main")
set_objectdir("build/obj")
set_targetdir("build/lib/" .. arch)
add_files({
src_root .. "/**.cc",
"third_party/lib/**.cpp"
})
add_links({
"c++_static",
"android",
"log",
"EGL",
"GLESv3",
"SDL3"
})
if is_mode("release") then
set_strip("all")
set_symbols("hidden")
set_optimize("fastest")
add_defines({
"SDL_ASSERT_LEVEL=0",
"NDEBUG"
})
add_cxxflags({
"-ffunction-sections",
"-fdata-sections",
"-flto=thin"
})
add_shflags({
"-Wl,--gc-sections",
"-flto=thin"
})
else -- Debug
set_symbols("debug", "hidden")
set_optimize("none")
add_defines("SDL_ASSERT_LEVEL=3")
end