-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path_preload.lua
More file actions
71 lines (61 loc) · 2.35 KB
/
_preload.lua
File metadata and controls
71 lines (61 loc) · 2.35 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
64
65
66
67
68
69
70
71
--
-- Name: codeblocks/_preload.lua
-- Purpose: Define Code::Blocks action (and its options).
-- Copyright: See attached license file
--
---@module 'premake5'
local p = premake
newaction {
trigger = "codeblocks",
shortname = "Code::Blocks",
description = "Generate Code::Blocks project files",
toolset = "gcc",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++" },
valid_tools = {
cc = { "clang", "gcc", "msc" },
},
pathVars = {
["wks.location"] = { absolute = true, token = "$(WORKSPACE_DIR)" },
["wks.name"] = { absolute = false, token = "$(WORKSPACE_NAME)" },
["sln.location"] = { absolute = true, token = "$(WORKSPACE_DIR)" },
["sln.name"] = { absolute = false, token = "$(WORKSPACE_NAME)" },
["prj.location"] = { absolute = true, token = "$(PROJECT_DIR)" },
["prj.name"] = { absolute = false, token = "$(PROJECT_NAME)" },
["cfg.targetdir"] = { absolute = true, token = "$(PROJECT_DIR)$(TARGET_OUTPUT_DIR)" },
["cfg.buildcfg"] = { absolute = false, token = "$(TARGET_NAME)" },
["cfg.buildtarget.basename"] = { absolute = false, token = "$(TARGET_OUTPUT_BASENAME)" },
["cfg.buildtarget.relpath"] = { absolute = false, token = "$(TARGET_OUTPUT_FILE)" },
["file.directory"] = { absolute = true, token = "$file_dir" },
["file.basename"] = { absolute = false, token = "$file_name" },
["file.abspath"] = { absolute = true, token = "$file" },
},
onWorkspace = function(wks)
p.modules.codeblocks.generateWorkspace(wks)
end,
onProject = function(prj)
p.modules.codeblocks.generateProject(prj)
end,
onCleanWorkspace = function(wks)
p.modules.codeblocks.cleanWorkspace(wks)
end,
onCleanProject = function(prj)
p.modules.codeblocks.cleanProject(prj)
end,
onCleanTarget = function(tgt)
p.modules.codeblocks.cleanTarget(tgt)
end
}
newoption {
trigger = "codeblocks-check",
value = "ENABLE",
description = "codeblocks: check configuration consistency",
allowed = {
{ "true", "Enabled (*)" }, { "false", "Disabled" }
},
default = "true"
}
-- Decide when the full module should be loaded.
return function(cfg)
return (_ACTION == "codeblocks")
end