v4k-git-backup/tools/premake5.lua

112 lines
2.6 KiB
Lua
Raw Normal View History

2023-08-10 14:30:56 +00:00
require "ninja"
-- workspace
workspace "project"
configurations { "devel", "debug", "release" }
location "../_project"
targetdir "../_%{cfg.buildcfg}"
configuration "windows"
platforms { "x64" }
buildoptions "/W1"
-- entrypoint "main"
-- buildoptions { "/utf-8" } "/W3", "/wd4996", "/wd4244", "/wd4305", "/wd4267"} -- "/EHsc-"}
-- links { "user32", "gdi32" }
-- flags { "/MT" }
configuration "linux"
links { "pthread", "X11", "m", "dl" }
filter "configurations:debug"
symbols "On"
optimize "Off"
filter "configurations:devel"
symbols "On"
optimize "On"
filter "configurations:release"
defines {"NDEBUG"}
symbols "Off"
optimize "On"
-- dlls
project "engine"
language "C"
kind "SharedLib"
files {"../engine/v4k.c"}
includedirs {"../engine/"}
defines {"API=EXPORT"}
-- exes
project "editor"
language "C"
kind "ConsoleApp" -- "WindowedApp"
links {"engine"} defines {"API=IMPORT"}
files {
"../tools/editor/**.",
"../tools/editor/**.h*",
"../tools/editor/editor.c",
}
includedirs {
"../tools/editor/",
"../engine/",
}
project "editor2"
language "C"
kind "ConsoleApp"
files {
"../tools/editor/**.",
"../tools/editor/**.h*",
"../tools/editor/editor2.c",
}
includedirs {
"../tools/editor/",
"../engine/",
}
-- demos
function demos(...)
for _, name in ipairs({...}) do
project (name)
-- defaults()
uuid (os.uuid(name))
language "C"
kind "consoleApp" -- "WindowedApp"
includedirs {"../engine/"}
links {"engine"} defines {"API=IMPORT"} -- kind "SharedLib" links {"engine"}
includedirs {"../engine/", "../tools/editor/"}
files {
"../demos/*"..name.."*.h*",
"../demos/*"..name.."*.c*",
"../demos/*"..name.."*.inl",
}
end
end
demos(
"bytebeat"
)
-- games
function games(...)
for _, name in ipairs({...}) do
project ("game-" .. name)
uuid (os.uuid("game-" .. name))
language "C++"
kind "consoleApp"
includedirs {"../engine/"}
links {"engine"} defines {"API=IMPORT"} -- kind "SharedLib" links {"engine"}
includedirs {"../engine/", "../tools/editor/"}
files {
"../games/"..name.."/**.h*",
"../games/"..name.."/**.c*",
"../games/"..name.."/**.inl",
}
-- defaults()
end
end
-- games("untitled")