From 9c0f3563a5a891769b6fed30533a2ac74920876b Mon Sep 17 00:00:00 2001 From: anulax1225 Date: Thu, 29 Feb 2024 04:29:25 +0100 Subject: [PATCH] Changed premake config by adding two new projects for the client and the server. and making bakanet a staticlib --- premake5.lua | 73 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 6 deletions(-) diff --git a/premake5.lua b/premake5.lua index 2de168a..e379902 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,7 +1,6 @@ -workspace "socket_test" +workspace "socket_unix" architecture "x64" configurations { "Debug", "Release" } - startproject "sandbox" flags { "MultiProcessorCompile" @@ -11,8 +10,60 @@ outputdir = "%{cfg.system}-%{cfg.architecture}-%{cfg.buildcfg}" IncludeDirs = {} -project "sandbox" - kind "ConsoleApp" +IncludeDirs["bakanet"] = "%{wks.location}/bakanet/src/" + +project "bakanet" + location "./bakanet" + kind "StaticLib" + language "C++" + cppdialect "C++17" + systemversion "latest" + + targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") + objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") + + includedirs + { + "%{IncludeDirs.bakanet}" + } + + files + { + "%{prj.location}/src/**.h", + "%{prj.location}/src/**.cpp" + } + +project "server" + location "./sandbox/server" + kind "ConsoleApp" + language "C++" + cppdialect "C++17" + systemversion "latest" + + targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") + objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") + + includedirs + { + "%{IncludeDirs.bakanet}" + } + + files + { + "%{prj.location}/**.h", + "%{prj.location}/**.cpp" + } + + links + { + "bakanet" + } + + + +project "client" + location "./sandbox/client" + kind "ConsoleApp" language "C++" cppdialect "C++17" systemversion "latest" @@ -20,8 +71,18 @@ project "sandbox" targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") + includedirs + { + "%{IncludeDirs.bakanet}" + } + files { - "src/**.h", - "src/**.cpp" + "%{prj.location}/**.h", + "%{prj.location}/**.cpp" + } + + links + { + "bakanet" } \ No newline at end of file