-
Notifications
You must be signed in to change notification settings - Fork 0
/
_preload.lua
38 lines (32 loc) · 899 Bytes
/
_preload.lua
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
local p = premake
p.extensions.cmake = { _VERSION = "1.0.0" }
newaction({
-- Metadata
trigger = "cmake",
shortname = "CMake",
description = "Generate CMake files",
toolset = "clang",
-- Capabilities
valid_kinds = { "ConsoleApp", "WindowedApp", "Makefile", "SharedLib", "StaticLib", "Utility" },
valid_languages = { "C", "C++" },
valid_tools = { "gcc", "clang", "msc" },
-- Workspace generation
onWorkspace = function(wks)
p.generate(wks, "CMakeLists.txt", p.extensions.cmake.generateWorkspace)
end,
-- Project generation
onProject = function(prj)
if prj.kind == "Utility" then return end
p.generate(prj, ".cmake", p.extensions.cmake.generateProject)
end,
-- End
onEnd = function()
p.extensions.cmake.common.printTimers()
end
})
--
-- Decide when the full module should be loaded.
--
return function(cfg)
return _ACTION == "cmake"
end