parent
eaf695c45d
commit
9895eb5b98
31 changed files with 108 additions and 238 deletions
@ -1,6 +0,0 @@ |
|||||||
[submodule "vendor/spdlog"] |
|
||||||
path = vendor/spdlog |
|
||||||
url = https://github.com/gabime/spdlog |
|
||||||
[submodule "vendor/bakatools"] |
|
||||||
path = vendor/bakatools |
|
||||||
url = https://github.com/anulax1225/bakatools |
|
@ -1,82 +0,0 @@ |
|||||||
project "bakanet" |
|
||||||
kind "StaticLib" |
|
||||||
language "C++" |
|
||||||
cppdialect "C++20" |
|
||||||
systemversion "latest" |
|
||||||
staticruntime "on" |
|
||||||
|
|
||||||
targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") |
|
||||||
objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") |
|
||||||
|
|
||||||
defines |
|
||||||
{ |
|
||||||
"BKMOD_ALL" |
|
||||||
} |
|
||||||
|
|
||||||
includedirs |
|
||||||
{ |
|
||||||
"%{IncludeDirs.spdlog}", |
|
||||||
"%{IncludeDirs.bakanet}", |
|
||||||
"%{IncludeDirs.bakatools}" |
|
||||||
} |
|
||||||
|
|
||||||
files |
|
||||||
{ |
|
||||||
"%{prj.location}/src/bakanet/**.h", |
|
||||||
"%{prj.location}/src/bakanet/**.cpp", |
|
||||||
"%{prj.location}/src/baknetpch.h", |
|
||||||
} |
|
||||||
|
|
||||||
links |
|
||||||
{ |
|
||||||
"bakatools" |
|
||||||
} |
|
||||||
|
|
||||||
filter "system:windows" |
|
||||||
buildoptions "/MDd" |
|
||||||
defines |
|
||||||
{ |
|
||||||
"BK_PLATFORM_WINDOWS" |
|
||||||
} |
|
||||||
|
|
||||||
files |
|
||||||
{ |
|
||||||
"%{prj.location}/src/platform/windows/**.h", |
|
||||||
"%{prj.location}/src/platform/windows/**.cpp", |
|
||||||
} |
|
||||||
|
|
||||||
links |
|
||||||
{ |
|
||||||
"WS2_32.lib" |
|
||||||
} |
|
||||||
|
|
||||||
filter "system:linux" |
|
||||||
defines |
|
||||||
{ |
|
||||||
"BK_PLATFORM_LINUX" |
|
||||||
} |
|
||||||
|
|
||||||
files |
|
||||||
{ |
|
||||||
"%{prj.location}/src/platform/linux/**.h", |
|
||||||
"%{prj.location}/src/platform/linux/**.cpp", |
|
||||||
} |
|
||||||
|
|
||||||
filter "configurations:Debug" |
|
||||||
defines |
|
||||||
{ |
|
||||||
"BK_DEBUG", |
|
||||||
"DEBUG" |
|
||||||
} |
|
||||||
runtime "Debug" |
|
||||||
symbols "on" |
|
||||||
|
|
||||||
|
|
||||||
filter "configurations:Release" |
|
||||||
defines |
|
||||||
{ |
|
||||||
"BK_RELEASE", |
|
||||||
"NDEBUG" |
|
||||||
} |
|
||||||
runtime "Release" |
|
||||||
optimize "on" |
|
@ -1,23 +0,0 @@ |
|||||||
|
|
||||||
|
|
||||||
handle_error() { |
|
||||||
echo "An error occurred on line $1" |
|
||||||
exit 1 |
|
||||||
} |
|
||||||
trap 'handle_error $LINENO' ERR |
|
||||||
|
|
||||||
if [ "-clear" == "$1" ]; then |
|
||||||
rm -rf bin bin-int |
|
||||||
fi |
|
||||||
|
|
||||||
if [ "-clear" == "$2" ]; then |
|
||||||
rm -rf bin bin-int |
|
||||||
fi |
|
||||||
|
|
||||||
clear |
|
||||||
premake5 gmake2 |
|
||||||
make |
|
||||||
|
|
||||||
if [ "-exec" == "$1" ]; then |
|
||||||
./bin/linux-x86_64-Debug/server/server |
|
||||||
fi |
|
@ -0,0 +1,12 @@ |
|||||||
|
{ |
||||||
|
"name": "Bakanet", |
||||||
|
"owner": "Anulax", |
||||||
|
"git": "https://github.com/anulax1225/bakanet", |
||||||
|
"packages": |
||||||
|
[ |
||||||
|
{ |
||||||
|
"author": "anulax1225", |
||||||
|
"name": "bakatools" |
||||||
|
} |
||||||
|
] |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
IncludeDirs["bakanet"] = "%{wks.location}/vendor/bakanet/src/" |
||||||
|
|
||||||
|
group "Bakanet" |
||||||
|
include "vendor/bakanet" |
||||||
|
group "" |
@ -0,0 +1,9 @@ |
|||||||
|
includedirs |
||||||
|
{ |
||||||
|
"%{IncludeDirs.bakanet}" |
||||||
|
} |
||||||
|
|
||||||
|
links |
||||||
|
{ |
||||||
|
"bakanet" |
||||||
|
} |
@ -1,27 +1,82 @@ |
|||||||
workspace "BakaraNet" |
project "bakanet" |
||||||
architecture "x64" |
kind "StaticLib" |
||||||
configurations { "Debug", "Release" } |
language "C++" |
||||||
startproject "server" |
cppdialect "C++20" |
||||||
flags |
systemversion "latest" |
||||||
|
staticruntime "on" |
||||||
|
|
||||||
|
targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") |
||||||
|
objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") |
||||||
|
|
||||||
|
defines |
||||||
|
{ |
||||||
|
"BKMOD_ALL" |
||||||
|
} |
||||||
|
|
||||||
|
includedirs |
||||||
|
{ |
||||||
|
"%{IncludeDirs.spdlog}", |
||||||
|
"%{IncludeDirs.bakanet}", |
||||||
|
"%{IncludeDirs.bakatools}" |
||||||
|
} |
||||||
|
|
||||||
|
files |
||||||
|
{ |
||||||
|
"%{prj.location}/src/bakanet/**.h", |
||||||
|
"%{prj.location}/src/bakanet/**.cpp", |
||||||
|
"%{prj.location}/src/baknetpch.h", |
||||||
|
} |
||||||
|
|
||||||
|
links |
||||||
|
{ |
||||||
|
"bakatools" |
||||||
|
} |
||||||
|
|
||||||
|
filter "system:windows" |
||||||
|
buildoptions "/MDd" |
||||||
|
defines |
||||||
{ |
{ |
||||||
"MultiProcessorCompile" |
"BK_PLATFORM_WINDOWS" |
||||||
} |
} |
||||||
|
|
||||||
outputdir = "%{cfg.system}-%{cfg.architecture}-%{cfg.buildcfg}" |
files |
||||||
|
{ |
||||||
|
"%{prj.location}/src/platform/windows/**.h", |
||||||
|
"%{prj.location}/src/platform/windows/**.cpp", |
||||||
|
} |
||||||
|
|
||||||
|
links |
||||||
|
{ |
||||||
|
"WS2_32.lib" |
||||||
|
} |
||||||
|
|
||||||
|
filter "system:linux" |
||||||
|
defines |
||||||
|
{ |
||||||
|
"BK_PLATFORM_LINUX" |
||||||
|
} |
||||||
|
|
||||||
IncludeDirs = {} |
files |
||||||
IncludeDirs["bakanet"] = "%{wks.location}/bakanet/src/" |
{ |
||||||
IncludeDirs["bakatools"] = "%{wks.location}/vendor/bakatools/src/" |
"%{prj.location}/src/platform/linux/**.h", |
||||||
IncludeDirs["spdlog"] = "%{wks.location}/vendor/spdlog/include" |
"%{prj.location}/src/platform/linux/**.cpp", |
||||||
|
} |
||||||
|
|
||||||
group "BakaModules" |
filter "configurations:Debug" |
||||||
include "vendor/bakatools" |
defines |
||||||
group "" |
{ |
||||||
|
"BK_DEBUG", |
||||||
|
"DEBUG" |
||||||
|
} |
||||||
|
runtime "Debug" |
||||||
|
symbols "on" |
||||||
|
|
||||||
group "NetCore" |
|
||||||
include "bakanet" |
|
||||||
group "" |
|
||||||
|
|
||||||
group "Sandbox" |
filter "configurations:Release" |
||||||
include "sandbox" |
defines |
||||||
group "" |
{ |
||||||
|
"BK_RELEASE", |
||||||
|
"NDEBUG" |
||||||
|
} |
||||||
|
runtime "Release" |
||||||
|
optimize "on" |
@ -1,66 +0,0 @@ |
|||||||
project "server" |
|
||||||
location "./server" |
|
||||||
kind "ConsoleApp" |
|
||||||
language "C++" |
|
||||||
cppdialect "C++20" |
|
||||||
systemversion "latest" |
|
||||||
|
|
||||||
targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") |
|
||||||
objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") |
|
||||||
|
|
||||||
defines |
|
||||||
{ |
|
||||||
"BKMOD_ALL" |
|
||||||
} |
|
||||||
|
|
||||||
includedirs |
|
||||||
{ |
|
||||||
"%{IncludeDirs.spdlog}", |
|
||||||
"%{IncludeDirs.bakanet}", |
|
||||||
"%{IncludeDirs.bakatools}" |
|
||||||
} |
|
||||||
|
|
||||||
files |
|
||||||
{ |
|
||||||
"%{prj.location}/**.h", |
|
||||||
"%{prj.location}/**.cpp", |
|
||||||
} |
|
||||||
|
|
||||||
links |
|
||||||
{ |
|
||||||
"bakanet", |
|
||||||
"bakatools" |
|
||||||
} |
|
||||||
|
|
||||||
filter "system:linux" |
|
||||||
defines |
|
||||||
{ |
|
||||||
"BK_PLATFORM_LINUX" |
|
||||||
} |
|
||||||
|
|
||||||
filter "system:windows" |
|
||||||
buildoptions "/MDd" |
|
||||||
defines |
|
||||||
{ |
|
||||||
"BK_PLATFORM_WINDOWS" |
|
||||||
} |
|
||||||
|
|
||||||
filter "configurations:Debug" |
|
||||||
defines |
|
||||||
{ |
|
||||||
"BK_DEBUG", |
|
||||||
"DEBUG" |
|
||||||
} |
|
||||||
runtime "Debug" |
|
||||||
symbols "on" |
|
||||||
|
|
||||||
filter "configurations:Release" |
|
||||||
defines |
|
||||||
{ |
|
||||||
"BK_RELEASE", |
|
||||||
"NDEBUG" |
|
||||||
} |
|
||||||
runtime "Release" |
|
||||||
optimize "on" |
|
||||||
|
|
||||||
|
|
@ -1,32 +0,0 @@ |
|||||||
#include <bakatools.h> |
|
||||||
#include <bakanet.h> |
|
||||||
|
|
||||||
#define PORT 8080 |
|
||||||
|
|
||||||
using namespace Bk::Net; |
|
||||||
|
|
||||||
int main()
|
|
||||||
{ |
|
||||||
Bk::Log::init("Bakanet"); |
|
||||||
IpAddress ip; |
|
||||||
HttpServer server(ip, PORT); |
|
||||||
server.get("/", [](HttpRequest& req) |
|
||||||
{ |
|
||||||
BK_INFO("URL /"); |
|
||||||
HttpReponse res(HTTP_RES_200, req.version); |
|
||||||
res.body = "<p>Coucou de /</p>"; |
|
||||||
return res; |
|
||||||
}); |
|
||||||
server.post("/home/", [](HttpRequest& req) |
|
||||||
{ |
|
||||||
HttpReponse res(HTTP_RES_200, "HTTP/1.1"); |
|
||||||
res.body = "Success"; |
|
||||||
BK_INFO("\n{0}\n{1}", req.body, res.to_string()); |
|
||||||
return res; |
|
||||||
}); |
|
||||||
server.start(); |
|
||||||
return 0; |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1 +0,0 @@ |
|||||||
Subproject commit 40d24e39a7a7b39a056418d78162103036e6534a |
|
@ -1 +0,0 @@ |
|||||||
Subproject commit 23587b0d9aebad231d7ba4f16873d70edd2b9dee |
|
Loading…
Reference in New Issue