iw5-mod/premake5.lua

128 lines
2.0 KiB
Lua
Raw Normal View History

2018-12-26 07:16:21 -05: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
2018-12-23 17:21:15 -05:00
newoption {
trigger = "copy-to",
description = "Optional, copy the EXE to a custom folder after build, define the path here if wanted.",
value = "PATH"
}
2018-12-26 07:16:21 -05:00
dependencies.load()
2018-12-23 17:21:15 -05:00
workspace "open-iw5"
2018-12-01 09:42:29 -05:00
location "./build"
objdir "%{wks.location}/obj"
targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
configurations {
"Debug",
"Release",
}
architecture "x32"
platforms "x32"
buildoptions "/std:c++latest"
systemversion "latest"
symbols "On"
staticruntime "On"
2018-12-23 17:21:15 -05:00
editandcontinue "Off"
2018-12-01 09:42:29 -05:00
warnings "Extra"
2018-12-23 16:15:32 -05:00
flags {
"NoIncrementalLink",
"NoMinimalRebuild",
"MultiProcessorCompile",
"No64BitChecks"
}
2018-12-01 09:42:29 -05:00
configuration "windows"
defines {
"_WINDOWS",
"WIN32",
}
configuration "Release"
optimize "Full"
defines {
"NDEBUG",
}
flags {
"FatalCompileWarnings",
}
configuration "Debug"
optimize "Debug"
defines {
"DEBUG",
"_DEBUG",
}
configuration {}
2018-12-23 17:21:15 -05:00
project "open-iw5"
kind "ConsoleApp"
2018-12-01 09:42:29 -05:00
language "C++"
pchheader "std_include.hpp"
pchsource "src/std_include.cpp"
2018-12-23 16:15:32 -05:00
linkoptions "/IGNORE:4254 /DYNAMICBASE:NO /SAFESEH:NO /LARGEADDRESSAWARE"
2018-12-26 10:59:03 -05:00
linkoptions "/LAST:.main"
2018-12-23 16:15:32 -05:00
2018-12-01 09:42:29 -05:00
files {
"./src/**.rc",
"./src/**.hpp",
"./src/**.cpp"
}
includedirs {
"./src"
}
resincludedirs {
"$(ProjectDir)src"
}
2018-12-23 17:21:15 -05:00
if _OPTIONS["copy-to"] then
postbuildcommands {
"copy /y \"$(TargetDir)*.exe\" \"" .. _OPTIONS["copy-to"] .. "\""
}
end
2018-12-26 07:16:21 -05:00
dependencies.imports()
group "Dependencies"
dependencies.projects()