forked from InfiniTensor/llaisys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
122 lines (93 loc) · 2.68 KB
/
xmake.lua
File metadata and controls
122 lines (93 loc) · 2.68 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
add_rules("mode.debug", "mode.release")
set_encodings("utf-8")
add_includedirs("include")
-- CPU --
includes("xmake/cpu.lua")
-- NVIDIA --
option("nv-gpu")
set_default(false)
set_showmenu(true)
set_description("Whether to compile implementations for Nvidia GPU")
option_end()
if has_config("nv-gpu") then
add_defines("ENABLE_NVIDIA_API")
includes("xmake/nvidia.lua")
end
target("llaisys-utils")
set_kind("static")
set_languages("cxx17")
set_warnings("all", "error")
if not is_plat("windows") then
add_cxflags("-fPIC", "-Wno-unknown-pragmas")
end
add_files("src/utils/*.cpp")
on_install(function (target) end)
target_end()
target("llaisys-device")
set_kind("static")
add_deps("llaisys-utils")
add_deps("llaisys-device-cpu")
set_languages("cxx17")
set_warnings("all", "error")
if not is_plat("windows") then
add_cxflags("-fPIC", "-Wno-unknown-pragmas")
end
add_files("src/device/*.cpp")
on_install(function (target) end)
target_end()
target("llaisys-core")
set_kind("static")
add_deps("llaisys-utils")
add_deps("llaisys-device")
set_languages("cxx17")
set_warnings("all", "error")
if not is_plat("windows") then
add_cxflags("-fPIC", "-Wno-unknown-pragmas")
end
add_files("src/core/*/*.cpp")
on_install(function (target) end)
target_end()
target("llaisys-tensor")
set_kind("static")
add_deps("llaisys-core")
set_languages("cxx17")
set_warnings("all", "error")
if not is_plat("windows") then
add_cxflags("-fPIC", "-Wno-unknown-pragmas")
end
add_files("src/tensor/*.cpp")
on_install(function (target) end)
target_end()
target("llaisys-ops")
set_kind("static")
add_deps("llaisys-ops-cpu")
set_languages("cxx17")
set_warnings("all", "error")
if not is_plat("windows") then
add_cxflags("-fPIC", "-Wno-unknown-pragmas")
end
add_files("src/ops/*/*.cpp")
on_install(function (target) end)
target_end()
target("llaisys")
set_kind("shared")
add_deps("llaisys-utils")
add_deps("llaisys-device")
add_deps("llaisys-core")
add_deps("llaisys-tensor")
add_deps("llaisys-ops")
set_languages("cxx17")
set_warnings("all", "error")
add_files("src/llaisys/*.cc")
set_installdir(".")
after_install(function (target)
-- copy shared library to python package
print("Copying llaisys to python/llaisys/libllaisys/ ..")
if is_plat("windows") then
os.cp("bin/*.dll", "python/llaisys/libllaisys/")
end
if is_plat("linux") then
os.cp("lib/*.so", "python/llaisys/libllaisys/")
end
end)
target_end()