iw5-mod/premake5.lua

123 lines
2.2 KiB
Lua
Raw Normal View History

2019-09-24 04:30:08 -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
newoption {
trigger = "copy-to",
description = "Optional, copy the EXE to a custom folder after build, define the path here if wanted.",
value = "PATH"
}
dependencies.load()
2024-05-15 01:44:47 -04:00
workspace "iw5-mod"
startproject "iw5-mod"
2019-09-24 04:30:08 -04:00
location "./build"
objdir "%{wks.location}/obj"
targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
2022-12-09 09:44:00 -05:00
configurations {"Debug", "Release"}
2022-03-09 20:12:16 -05:00
language "C++"
cppdialect "C++20"
2019-09-24 04:30:08 -04:00
2022-03-09 20:12:16 -05:00
architecture "x86"
platforms "Win32"
2019-09-24 04:30:08 -04:00
systemversion "latest"
symbols "On"
staticruntime "On"
editandcontinue "Off"
warnings "Extra"
characterset "ASCII"
flags {
"NoIncrementalLink",
"NoMinimalRebuild",
"MultiProcessorCompile",
"No64BitChecks"
}
2022-03-09 20:12:16 -05:00
filter "platforms:Win*"
2022-12-09 09:44:00 -05:00
defines {"_WINDOWS", "WIN32"}
2022-03-09 20:12:16 -05:00
filter {}
2019-09-24 04:30:08 -04:00
2022-03-09 20:12:16 -05:00
filter "configurations:Release"
2022-12-09 09:44:00 -05:00
optimize "Size"
2022-12-09 09:45:34 -05:00
buildoptions {"/Os"}
2022-12-09 09:44:00 -05:00
defines {"NDEBUG"}
flags {"FatalCompileWarnings"}
2022-03-09 20:12:16 -05:00
filter {}
2019-09-24 04:30:08 -04:00
2022-03-09 20:12:16 -05:00
filter "configurations:Debug"
2019-09-24 04:30:08 -04:00
optimize "Debug"
2022-12-09 09:44:00 -05:00
defines {"DEBUG", "_DEBUG"}
2022-03-09 20:12:16 -05:00
filter {}
2019-09-24 04:30:08 -04:00
2024-05-15 01:44:47 -04:00
project "iw5-mod"
2019-09-24 04:30:08 -04:00
kind "ConsoleApp"
language "C++"
pchheader "std_include.hpp"
pchsource "src/std_include.cpp"
2022-12-09 09:44:00 -05:00
linkoptions {
"/IGNORE:4254",
"/DYNAMICBASE:NO",
"/SAFESEH:NO",
"/LARGEADDRESSAWARE",
"/LAST:.main"
}
2019-09-24 04:30:08 -04:00
files {
"./src/**.rc",
"./src/**.hpp",
"./src/**.cpp",
"./src/resources/**.*"
}
includedirs {
"./src"
}
resincludedirs {
"$(ProjectDir)src"
}
if _OPTIONS["copy-to"] then
postbuildcommands {
"copy /y \"$(TargetDir)*.exe\" \"" .. _OPTIONS["copy-to"] .. "\""
}
end
dependencies.imports()
group "Dependencies"
dependencies.projects()