refactor(build): restructure into separate server targets

Update xmake.lua to split into HTTP, file, and DNS server targets with
individual source directories. Remove old main.cpp and add test.txt for new
functionality.
This commit is contained in:
Ваше Имя
2025-09-30 18:57:16 +04:00
parent 7dac7fb0de
commit c02ba25371
3 changed files with 31 additions and 25 deletions
+30 -9
View File
@@ -2,16 +2,37 @@ set_languages "c++23"
add_rules("plugin.compile_commands.autoupdate", { outputdir = "." })
add_requires("boost", {
system = true, -- sudo pacman -S boost
add_requires("cmake::Boost", {
alias = "boost",
system = true,
configs = {
all = false,
system = true, -- asio
components = { "program_options", "log" },
},
})
target "app"
set_kind "binary"
add_files "src/*.cpp"
add_links "boost_system"
-- HTTP server target
target "http_server"
do
set_kind "binary"
add_files("src/main/main_http.cpp", "src/http/*.cpp", "src/common/*.cpp")
add_includedirs("src", "src/http", "src/common", { public = true })
add_packages "boost"
end
-- File server target
target "file_server"
do
set_kind "binary"
add_files("src/main/main_file.cpp", "src/file/*.cpp", "src/common/*.cpp")
add_includedirs("src", "src/file", "src/common", { public = true })
add_packages "boost"
end
-- DNS server target
target "dns_server"
do
set_kind "binary"
add_files("src/main/main_dns.cpp", "src/dns/*.cpp", "src/common/*.cpp")
add_includedirs("src", "src/dns", "src/common", { public = true })
add_packages "boost"
end