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
-16
View File
@@ -1,16 +0,0 @@
#include <boost/asio.hpp>
#include <iostream>
int main()
{
std::cout << "Hello, Boost + C++23 + xmake!\n";
boost::asio::io_context io;
boost::asio::steady_timer timer(io, std::chrono::seconds(1));
timer.async_wait([](const boost::system::error_code &) {
std::cout << "Timer fired after 1 second!\n";
});
io.run();
return 0;
}
+1
View File
@@ -0,0 +1 @@
Hello from file!
+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