-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
92 lines (77 loc) · 2.38 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
84
85
86
87
88
89
90
91
92
-- Copyright 2022 Vincil Lau
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
set_project("waka-server")
version = "0.1.0"
set_version(version)
set_languages("c++17")
add_rules("mode.debug", "mode.release")
add_requires(
"cli11",
"cpp-httplib",
"fmt",
"gtest",
"nlohmann_json",
"spdlog",
"sqlite3"
)
target("waka-server")
set_kind("binary")
set_targetdir("$(projectdir)")
add_files("src/main.cpp")
add_includedirs("src")
add_defines("SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE")
add_defines("SPDLOG_FMT_EXTERNAL=ON")
add_defines("CPPHTTPLIB_THREAD_POOL_COUNT=1")
if is_plat("windows") then
add_cxxflags("/source-charset:utf-8", "/execution-charset:utf-8")
end
add_deps("waka-server_static")
add_links("waka-server_static")
add_packages(
"cli11",
"cpp-httplib",
"fmt",
"nlohmann_json",
"spdlog",
"sqlite3"
)
target("waka-server_static", "test_main")
set_kind("static")
set_configdir("$(projectdir)/src")
set_configvar("WAKA_VERSION", version)
set_configvar("WAKA_PROJECT_DIR", "$(projectdir)")
add_configfiles("src/define.hpp.in")
add_files("src/common/**.cpp")
add_files("src/controller/**.cpp")
add_files("src/dao/**.cpp")
add_files("src/dto/**.cpp")
add_files("src/http/**.cpp")
add_files("src/service/**.cpp")
add_includedirs("src")
add_defines("SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE")
add_defines("SPDLOG_FMT_EXTERNAL=ON")
if is_plat("linux") then
add_defines("WAKA_PLATFORM=WAKA_PLATFORM_LINUX")
elseif is_plat("windows") then
add_defines("WAKA_PLATFORM=WAKA_PLATFORM_WINDOWS")
add_cxxflags("/source-charset:utf-8", "/execution-charset:utf-8")
end
add_packages(
"cpp-httplib",
"fmt",
"nlohmann_json",
"spdlog",
"sqlite3"
)
includes("test")