forked from jimon/premake-ninja
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_preload.lua
More file actions
63 lines (56 loc) · 1.46 KB
/
_preload.lua
File metadata and controls
63 lines (56 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--
-- Name: premake-ninja/_preload.lua
-- Purpose: Define the ninja action.
-- Author: Dmitry Ivanov
-- Created: 2015/07/04
-- Copyright: (c) 2015 Dmitry Ivanov
--
local p = premake
local solution = premake.solution
local project = premake.project
newaction
{
-- Metadata for the command line and help system
trigger = "ninja",
shortname = "ninja",
description = "Ninja is a small build system with a focus on speed",
module = "ninja",
-- The capabilities of this action
valid_kinds = {"ConsoleApp", "WindowedApp", "Makefile", "SharedLib", "StaticLib"}, -- TODO do we need MakeFile ?
valid_languages = {"C", "C++"},
valid_tools = {cc = { "gcc", "clang", "msc" }},
-- Solution and project generation logic
onSolution = function(sln)
p.eol("\r\n")
p.indent(" ")
p.escaper(p.modules.ninja.esc)
p.generate(sln, "build.ninja", p.modules.ninja.generateSolution)
end,
onProject = function(prj)
p.eol("\r\n")
p.indent(" ")
p.escaper(p.modules.ninja.esc)
p.modules.ninja.generateProject(prj)
end,
onBranch = function(prj)
p.eol("\r\n")
p.indent(" ")
p.escaper(p.modules.ninja.esc)
p.modules.ninja.generateProject(prj)
end,
onCleanSolution = function(sln)
-- TODO
end,
onCleanProject = function(prj)
-- TODO
end,
onCleanTarget = function(prj)
-- TODO
end,
}
--
-- Decide when the full module should be loaded.
--
return function(cfg)
return (_ACTION == "ninja")
end