Skip to content

Commit 42d716b

Browse files
committed
Add "support" for kind "None" (as do nothing) for gmake/gmake2.
1 parent 7d4b2c1 commit 42d716b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

modules/gmake/_preload.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
description = "Generate GNU makefiles for POSIX, MinGW, and Cygwin",
1818
toolset = "gcc",
1919

20-
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Utility", "Makefile" },
20+
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Utility", "Makefile", "None" },
2121
valid_languages = { "C", "C++", "C#" },
2222
valid_tools = {
2323
cc = { "clang", "gcc" },
@@ -26,13 +26,17 @@
2626

2727
onWorkspace = function(wks)
2828
p.escaper(p.make.esc)
29+
wks.projects = table.filter(wks.projects, function(prj) return p.action.supports(prj.kind) and prj.kind ~= p.NONE end)
2930
p.generate(wks, p.make.getmakefilename(wks, false), p.make.generate_workspace)
3031
end,
3132

3233
onProject = function(prj)
3334
p.escaper(p.make.esc)
3435
local makefile = p.make.getmakefilename(prj, true)
35-
if prj.kind == p.UTILITY then
36+
37+
if not p.action.supports(prj.kind) or prj.kind == p.NONE then
38+
return
39+
elseif prj.kind == p.UTILITY then
3640
p.generate(prj, makefile, p.make.utility.generate)
3741
elseif prj.kind == p.MAKEFILE then
3842
p.generate(prj, makefile, p.make.makefile.generate)

modules/gmake2/_preload.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
description = "Generate GNU makefiles for POSIX, MinGW, and Cygwin",
1818
toolset = "gcc",
1919

20-
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Utility", "Makefile" },
20+
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Utility", "Makefile", "None" },
2121

2222
valid_languages = { "C", "C++", "C#" },
2323

@@ -33,13 +33,17 @@
3333

3434
onWorkspace = function(wks)
3535
p.escaper(p.modules.gmake2.esc)
36+
wks.projects = table.filter(wks.projects, function(prj) return p.action.supports(prj.kind) and prj.kind ~= p.NONE end)
3637
p.generate(wks, p.modules.gmake2.getmakefilename(wks, false), p.modules.gmake2.generate_workspace)
3738
end,
3839

3940
onProject = function(prj)
4041
p.escaper(p.modules.gmake2.esc)
4142
local makefile = p.modules.gmake2.getmakefilename(prj, true)
42-
if prj.kind == p.UTILITY then
43+
44+
if not p.action.supports(prj.kind) or prj.kind == p.NONE then
45+
return
46+
elseif prj.kind == p.UTILITY then
4347
p.generate(prj, makefile, p.modules.gmake2.utility.generate)
4448
elseif prj.kind == p.MAKEFILE then
4549
p.generate(prj, makefile, p.modules.gmake2.makefile.generate)

website/docs/kind.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Project configurations.
2727

2828
### Availability ###
2929

30-
The **Makefile**, and **None** kinds are only available in Premake 5.0 and later, and are currently only supported for Visual Studio.
30+
The **Makefile** kind is available in Premake 5.0 and later, and are supported for Visual Studio.
31+
The **None** kind is available in Premake 5.0 and later, and are supported for gmake, gmake2 and Visual Studio.
3132
The **Utility** kind is only available for Visual Studio and gmake2, as well as very limited support in gmake.
3233
The **SharedItems** kind is only available for Visual Studio 2013 and later.
3334

0 commit comments

Comments
 (0)