-
Notifications
You must be signed in to change notification settings - Fork 6
/
xmake.lua
80 lines (67 loc) · 2.67 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
add_rules("mode.debug", "mode.release")
add_repositories("my-repo repo")
add_requires(
"ygopro-core 0.0.2", "edopro-core", "pybind11 2.13.*", "fmt 10.2.*", "glog 0.6.0",
"sqlite3 3.43.0+200", "concurrentqueue 1.0.4", "unordered_dense 4.4.*",
"sqlitecpp 3.2.1")
target("ygopro0_ygoenv")
add_rules("python.library")
add_files("ygoenv/ygoenv/ygopro0/*.cpp")
add_packages("pybind11", "fmt", "glog", "concurrentqueue", "sqlitecpp", "unordered_dense", "ygopro-core")
set_languages("c++17")
if is_mode("release") then
set_policy("build.optimization.lto", true)
add_cxxflags("-march=native")
end
add_includedirs("ygoenv")
after_build(function (target)
local install_target = "$(projectdir)/ygoenv/ygoenv/ygopro0"
os.cp(target:targetfile(), install_target)
print("Copy target to " .. install_target)
end)
target("ygopro_ygoenv")
add_rules("python.library")
add_files("ygoenv/ygoenv/ygopro/*.cpp")
add_packages("pybind11", "fmt", "glog", "concurrentqueue", "sqlitecpp", "unordered_dense", "ygopro-core")
set_languages("c++17")
if is_mode("release") then
set_policy("build.optimization.lto", true)
add_cxxflags("-march=native")
end
add_includedirs("ygoenv")
after_build(function (target)
local install_target = "$(projectdir)/ygoenv/ygoenv/ygopro"
os.cp(target:targetfile(), install_target)
print("Copy target to " .. install_target)
end)
target("edopro_ygoenv")
add_rules("python.library")
add_files("ygoenv/ygoenv/edopro/*.cpp")
add_packages("pybind11", "fmt", "glog", "concurrentqueue", "sqlitecpp", "unordered_dense", "edopro-core")
set_languages("c++17")
if is_mode("release") then
set_policy("build.optimization.lto", true)
add_cxxflags("-march=native")
end
add_includedirs("ygoenv")
after_build(function (target)
local install_target = "$(projectdir)/ygoenv/ygoenv/edopro"
os.cp(target:targetfile(), install_target)
print("Copy target to " .. install_target)
end)
target("alphazero_mcts")
add_rules("python.library")
add_files("mcts/mcts/alphazero/*.cpp")
add_packages("pybind11")
set_languages("c++17")
if is_mode("release") then
set_policy("build.optimization.lto", true)
add_cxxflags("-march=native")
end
add_includedirs("mcts")
after_build(function (target)
local install_target = "$(projectdir)/mcts/mcts/alphazero"
os.cp(target:targetfile(), install_target)
print("Copy target to " .. install_target)
os.run("pybind11-stubgen mcts.alphazero.alphazero_mcts -o %s", "$(projectdir)/mcts")
end)