-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
97 lines (78 loc) · 2.26 KB
/
xmake.lua
File metadata and controls
97 lines (78 loc) · 2.26 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
86
87
88
89
90
91
92
93
94
95
96
97
-- xmake.lua for Atom Project
-- Author: Max Qian
-- License: GPL3
-- Add standard build modes
add_rules("mode.debug", "mode.release")
-- Project configuration
set_project("atom")
set_version("1.0.0")
set_languages("c++20")
set_license("GPL3")
-- Add options
option("shared_libs")
set_default(false)
set_showmenu(true)
set_description("Build shared libraries instead of static")
option_end()
option("build_python")
set_default(false)
set_showmenu(true)
set_description("Build Python bindings")
option_end()
option("build_examples")
set_default(false)
set_showmenu(true)
set_description("Build examples")
option_end()
option("build_tests")
set_default(false)
set_showmenu(true)
set_description("Build tests")
option_end()
-- Add required packages
add_requires("asio", {system = false})
add_requires("loguru", {system = false})
add_requires("zlib", {system = false})
add_requires("libzippp", {system = false})
add_requires("cpp-httplib", {system = false})
add_requires("tinyxml2", {system = false})
-- Optional packages
add_requires("cfitsio", {optional = true})
add_requires("libssh", {optional = true})
-- Windows-specific packages
if is_plat("windows") then
add_requires("dlfcn-win32", {system = false})
end
-- Conditionally add Python requirements
if has_config("build_python") then
add_requires("python 3.x", {system = false})
add_requires("pybind11", {system = false})
end
-- Include atom subdirectory
includes("atom")
-- Include examples if enabled
if has_config("build_examples") then
includes("example")
end
-- Include tests if enabled
if has_config("build_tests") then
includes("tests")
end
-- Create a task for easy installation
task("install")
on_run(function()
import("core.project.project")
import("core.platform.platform")
-- Set install prefix
local prefix = option.get("prefix") or "/usr/local"
-- Build the project
os.exec("xmake build")
-- Install the project
os.exec("xmake install -o " .. prefix)
cprint("${bright green}Atom has been installed to " .. prefix)
end)
set_menu {
usage = "xmake install",
description = "Install Atom libraries and headers"
}
task_end()