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 "alterware-master"
|
|
|
|
startproject "alterware-master"
|
|
|
|
location "./build"
|
|
|
|
objdir "%{wks.location}/obj"
|
|
|
|
targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
|
|
|
|
|
|
|
|
configurations {"Debug", "Release"}
|
|
|
|
|
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 { "platforms:arm64" }
|
|
|
|
buildoptions "--target=arm64-linux-gnu"
|
|
|
|
linkoptions "--target=arm64-linux-gnu"
|
|
|
|
filter {}
|
|
|
|
|
2023-11-12 07:17:01 -05:00
|
|
|
buildoptions "-stdlib=libc++"
|
|
|
|
linkoptions "-stdlib=libc++"
|
|
|
|
|
2023-08-08 06:21:04 -04:00
|
|
|
-- always try to use lld. LD or Gold will not work
|
2023-06-29 14:28:28 -04:00
|
|
|
linkoptions "-fuse-ld=lld"
|
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 _OPTIONS["dev-build"] then
|
|
|
|
defines {"DEV_BUILD"}
|
|
|
|
end
|
|
|
|
|
|
|
|
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"
|
|
|
|
optimize "Debug"
|
|
|
|
defines {"DEBUG", "_DEBUG"}
|
|
|
|
filter {}
|
|
|
|
|
|
|
|
project "alterware-master"
|
|
|
|
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()
|