master-tool/premake5.lua

142 lines
2.5 KiB
Lua
Raw Normal View History

2022-11-12 21:49:50 +00: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()
2023-06-23 14:17:09 +02:00
workspace "alterware-master-tool"
startproject "alterware-master-tool"
2022-11-12 21:49:50 +00:00
location "./build"
objdir "%{wks.location}/obj"
targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
2024-01-12 12:09:41 +01:00
configurations {"debug", "release"}
2022-11-12 21:49:50 +00:00
language "C++"
cppdialect "C++14"
2022-11-12 21:49:50 +00:00
if os.istarget("darwin") then
2023-06-25 15:18:37 +02:00
platforms {"x64", "arm64"}
2022-11-12 21:49:50 +00:00
else
2023-06-22 14:53:21 +02:00
platforms {"x86", "x64", "arm64"}
2022-11-12 21:49:50 +00:00
end
filter "platforms:x86"
architecture "x86"
filter {}
filter "platforms:x64"
architecture "x86_64"
filter {}
filter "platforms:arm64"
architecture "ARM64"
filter {}
filter {"system:windows"}
systemversion "latest"
filter {}
symbols "On"
staticruntime "On"
editandcontinue "Off"
warnings "Extra"
characterset "ASCII"
filter { "system:linux", "system:macosx" }
2022-11-12 21:49:50 +00:00
buildoptions "-pthread"
linkoptions "-pthread"
filter {}
2022-11-12 21:49:50 +00:00
if os.istarget("linux") then
2024-01-12 12:09:41 +01:00
filter { "toolset:clang*", "platforms:arm64" }
buildoptions "--target=arm64-linux-gnu"
linkoptions "--target=arm64-linux-gnu"
2023-06-25 15:18:37 +02:00
filter {}
2024-01-12 12:09:41 +01:00
filter { "toolset:clang*" }
-- always try to use lld. LD or Gold will not work
linkoptions "-fuse-ld=lld"
filter {}
2023-06-25 15:18:37 +02:00
end
filter { "system:macosx", "platforms:arm64" }
buildoptions "-arch arm64"
linkoptions "-arch arm64"
filter {}
2022-11-12 21:49:50 +00:00
if os.getenv("CI") then
defines "CI"
end
2023-05-20 21:37:23 +01:00
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile"}
2022-11-12 21:49:50 +00:00
filter "configurations:Release"
optimize "Size"
2022-11-12 21:49:50 +00:00
defines "NDEBUG"
flags "FatalCompileWarnings"
filter {}
filter "configurations:Debug"
optimize "Debug"
defines {"DEBUG", "_DEBUG"}
filter {}
2023-06-23 14:17:09 +02:00
project "alterware-master-tool"
2022-11-12 21:49:50 +00:00
kind "ConsoleApp"
2024-01-12 12:09:41 +01:00
2022-11-12 21:49:50 +00:00
language "C++"
2024-01-12 12:09:41 +01:00
cppdialect "C++14"
2022-11-12 21:49:50 +00:00
2023-06-23 14:17:09 +02:00
targetname "alterware-master-tool"
2022-11-12 21:49:50 +00:00
pchheader "std_include.hpp"
pchsource "src/std_include.cpp"
files {"./src/**.rc", "./src/**.hpp", "./src/**.cpp"}
includedirs {"./src", "%{prj.location}/src"}
filter {"system:windows", "toolset:not msc*"}
resincludedirs {
"%{_MAIN_SCRIPT_DIR}/src"
}
filter {}
filter {"system:windows", "toolset:msc*"}
resincludedirs {
"$(ProjectDir)src"
}
filter {}
dependencies.imports()
group "Dependencies"
dependencies.projects()