-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_preload.lua
More file actions
59 lines (51 loc) · 1.53 KB
/
Copy path_preload.lua
File metadata and controls
59 lines (51 loc) · 1.53 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
--
-- Name: premake-cmake/_preload.lua
-- Purpose: Define the cmake action.
-- Author: Jan "GamesTrap" Schürkamp
-- Created: 2025/11/20
-- Updated: 2026/02/01
-- Copyright: (c) 2025-2026 Jan "GamesTrap" Schürkamp
--
local p = premake
-- Support CMake executable_suffix
p.api.register {
name = "executable_suffix",
scope = "config",
kind = "string"
}
newaction
{
-- Metadata for the command line and help system
trigger = "cmake",
shortname = "cmake",
description = "CMake is a powerful and comprehensive solution for managing the software build process.",
-- The capabilities of this action
valid_kinds = {"ConsoleApp", "WindowedApp", "SharedLib", "StaticLib", "Utility", "Makefile", "None"}, -- Not supported: Packaging, SharedItems
valid_languages = {"C", "C++"},
valid_tools = {cc = { "gcc", "clang", "msc" }},
toolset = iif(os.target() == "windows", "msc-v143", --msc-v143 = Microsoft Visual Studio 2022
iif(os.target() == "macosx", "clang", "gcc")),
-- Workspace and project generation logic
onWorkspace = function(wks)
p.eol("\r\n")
p.indent(" ")
p.generate(wks, "CMakeLists.txt", p.modules.cmake.generateWorkspace)
end,
onProject = function(prj)
p.eol("\r\n")
p.indent(" ")
p.modules.cmake.generateProject(prj)
end,
onCleanWorkspace = function(wks)
p.modules.cmake.cleanWorkspace(wks)
end,
onCleanProject = function(prj)
p.modules.cmake.cleanProject(prj)
end,
}
--
-- Decide when the full module should be loaded.
--
return function(cfg)
return (_ACTION == "cmake")
end