master-server/premake5.lua

143 lines
2.5 KiB
Lua
Raw Normal View History

2023-05-26 10:09:29 -04:00
dependencies = {
basePath = "./deps"
}
function dependencies.load()
dir = path.join(dependencies.basePath, "premake/*.lua")
deps = os.matchfiles(dir)
for i, dep in pairs(deps) do
dep = dep:gsub(".lua", "")
require(dep)
end
end
function dependencies.imports()
for i, proj in pairs(dependencies) do
if type(i) == 'number' then
proj.import()
end
end
end
function dependencies.projects()
for i, proj in pairs(dependencies) do
if type(i) == 'number' then
proj.project()
end
end
end
dependencies.load()
workspace "master-server"
startproject "master-server"
2023-05-26 10:09:29 -04:00
location "./build"
objdir "%{wks.location}/obj"
targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
configurations {"debug", "release"}
2023-05-26 10:09:29 -04:00
2023-07-22 03:53:53 -04:00
language "C++"
cppdialect "C++20"
2023-05-26 10:09:29 -04:00
if os.istarget("darwin") then
2023-06-29 14:28:28 -04:00
platforms {"x64", "arm64"}
2023-05-26 10:09:29 -04:00
else
2023-06-23 16:39:53 -04:00
platforms {"x86", "x64", "arm64"}
2023-05-26 10:09:29 -04:00
end
filter "platforms:x86"
architecture "x86"
filter {}
filter "platforms:x64"
architecture "x86_64"
filter {}
filter "platforms:arm64"
architecture "ARM64"
filter {}
symbols "On"
staticruntime "On"
editandcontinue "Off"
warnings "Extra"
characterset "ASCII"
2023-06-29 14:28:28 -04:00
filter { "system:linux", "system:macosx" }
2023-05-26 10:09:29 -04:00
buildoptions "-pthread"
linkoptions "-pthread"
2023-06-29 14:28:28 -04:00
filter {}
if os.istarget("linux") then
filter { "toolset:clang*", "platforms:arm64" }
2023-06-29 14:28:28 -04:00
buildoptions "--target=arm64-linux-gnu"
linkoptions "--target=arm64-linux-gnu"
filter {}
filter { "toolset:clang*" }
buildoptions "-stdlib=libc++"
linkoptions "-stdlib=libc++"
2023-11-12 07:17:01 -05:00
-- always try to use lld. LD or Gold will not work
linkoptions "-fuse-ld=lld"
filter {}
2023-05-26 10:09:29 -04:00
end
2023-06-29 14:28:28 -04:00
filter { "system:macosx", "platforms:arm64" }
buildoptions "-arch arm64"
linkoptions "-arch arm64"
filter {}
2023-05-26 10:09:29 -04:00
if os.getenv("CI") then
defines "CI"
end
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"}
filter "configurations:release"
2023-08-08 06:21:04 -04:00
optimize "Size"
2023-07-22 03:53:53 -04:00
defines "NDEBUG"
2023-06-29 14:28:28 -04:00
flags "FatalCompileWarnings"
2023-05-26 10:09:29 -04:00
filter {}
filter "configurations:debug"
2023-05-26 10:09:29 -04:00
optimize "Debug"
defines {"DEBUG", "_DEBUG"}
filter {}
project "master-server"
2023-05-26 10:09:29 -04:00
kind "ConsoleApp"
language "C++"
pchheader "std_include.hpp"
pchsource "src/std_include.cpp"
files {"./src/**.rc", "./src/**.hpp", "./src/**.cpp"}
includedirs {"./src", "%{prj.location}/src"}
filter "system:windows"
files {
"./src/**.rc",
}
2023-08-08 06:21:04 -04:00
filter {}
2023-05-26 10:09:29 -04:00
filter { "system:windows", "toolset:not msc*" }
resincludedirs {
"%{_MAIN_SCRIPT_DIR}/src"
}
2023-08-08 06:21:04 -04:00
filter {}
2023-05-26 10:09:29 -04:00
filter { "system:windows", "toolset:msc*" }
resincludedirs {
2023-07-22 03:53:53 -04:00
"$(ProjectDir)src"
2023-05-26 10:09:29 -04:00
}
filter {}
dependencies.imports()
group "Dependencies"
dependencies.projects()