-
Notifications
You must be signed in to change notification settings - Fork 5
/
xmake.lua
83 lines (61 loc) · 2.2 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
--------------------------------------------------------------------------------
-- --
-- ::: :::::::: --
-- xmake.lua :+: :+: :+: --
-- +:+ +:+ +:+ --
-- By: maldavid <[email protected]> +#+ +:+ +#+ --
-- +#+#+#+#+#+ +#+ --
-- Created: 2023/12/07 15:21:38 by kbz_8 #+# #+# --
-- Updated: 2024/01/02 23:40:20 by kbz_8 ### ########.fr --
-- --
--------------------------------------------------------------------------------
-- Global settings
add_requires("libsdl", {configs = { sdlmain = false }})
add_rules("mode.debug", "mode.release")
set_languages("cxx17", "c99")
set_objectdir("objs/xmake/$(os)_$(arch)")
set_targetdir("./")
set_optimize("fastest")
-- Options
option("images_optimized")
set_default(true)
add_defines("IMAGE_OPTIMIZED")
option_end()
option("force_integrated_gpu")
set_default(false)
add_defines("FORCE_INTEGRATED_GPU")
option_end()
option("graphics_memory_dump")
set_default(false)
add_defines("GRAPHICS_MEMORY_DUMP")
option_end()
option("profiler")
set_default(false)
add_defines("PROFILER")
option_end()
-- Targets
target("mlx")
set_default(true)
set_license("MIT")
set_kind("shared")
add_options("images_optimized")
add_options("force_integrated_gpu")
add_options("graphics_memory_dump")
add_includedirs("includes", "src", "third_party")
add_defines("MLX_BUILD", "SDL_MAIN_HANDLED")
add_files("src/**.cpp")
add_packages("libsdl")
if is_mode("debug") then
add_defines("DEBUG")
end
target_end() -- optional but I think the code is cleaner with this -- optional but I think the code is cleaner with this
target("Test")
set_default(false)
set_kind("binary")
set_targetdir("example")
add_linkdirs("./")
add_deps("mlx")
add_files("example/main.c")
add_defines("SDL_MAIN_HANDLED")
add_packages("libsdl")
target_end()