Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of kind "None" for Codelite. #1762

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/codelite/_preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

-- The capabilities of this action

valid_kinds = { "ConsoleApp", "WindowedApp", "Makefile", "SharedLib", "StaticLib", "Utility" },
valid_kinds = { "ConsoleApp", "WindowedApp", "Makefile", "None", "SharedLib", "StaticLib", "Utility" },
valid_languages = { "C", "C++" },
valid_tools = {
cc = { "gcc", "clang", "msc" }
Expand Down
9 changes: 6 additions & 3 deletions modules/codelite/codelite_project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
ConsoleApp = "Console",
WindowedApp = "Console",
Makefile = "",
None = "",
Utility = "",
SharedLib = "Library",
StaticLib = "Library"
}
Expand Down Expand Up @@ -189,7 +191,7 @@
end

function m.compiler(cfg)
if configuration_iscustombuild(cfg) or configuration_isfilelist(cfg) then
if cfg.project.kind == p.NONE or configuration_iscustombuild(cfg) or configuration_isfilelist(cfg) then
_p(3, '<Compiler Required="no"/>')
return
end
Expand Down Expand Up @@ -219,7 +221,7 @@
end

function m.linker(cfg)
if configuration_iscustombuild(cfg) or configuration_isfilelist(cfg) then
if cfg.project.kind == p.NONE or configuration_iscustombuild(cfg) or configuration_isfilelist(cfg) then
_p(3, '<Linker Required="no"/>')
return
end
Expand Down Expand Up @@ -471,6 +473,7 @@
SharedLib = "Dynamic Library",
StaticLib = "Static Library",
WindowedApp = "Executable",
None = "",
Utility = "",
}

Expand All @@ -493,7 +496,7 @@
local cfgname = codelite.cfgname(cfg)
local compiler = m.getcompilername(cfg)
local debugger = m.debuggers[cfg.debugger] or m.debuggers.Default
local type = m.types[cfg.kind]
local type = m.types[cfg.kind] or ""

_x(2, '<Configuration Name="%s" CompilerType="%s" DebuggerType="%s" Type="%s" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">', cfgname, compiler, debugger, type)

Expand Down
17 changes: 17 additions & 0 deletions modules/codelite/tests/test_codelite_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
cfg = test.getconfig(prj, "Debug")
end

function suite.OnProjectCfg_KindNone()
kind "None"
prepare()
codelite.project.compiler(cfg)
test.capture [[
<Compiler Required="no"/>
]]
end

function suite.OnProjectCfg_Compiler()
prepare()
Expand Down Expand Up @@ -103,6 +111,15 @@
]]
end

function suite.OnProjectCfg_LinkerKindNone()
kind "None"
prepare()
codelite.project.linker(cfg)
test.capture [[
<Linker Required="no"/>
]]
end

function suite.OnProjectCfg_Linker()
prepare()
codelite.project.linker(cfg)
Expand Down
6 changes: 3 additions & 3 deletions website/docs/kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Project configurations.

### Availability ###

The **Makefile** kind is available in Premake 5.0 and later, and are supported for Visual Studio.
The **None** kind is available in Premake 5.0 and later, and are supported for gmake, gmake2 and Visual Studio.
The **Utility** kind is only available for Visual Studio and gmake2, as well as very limited support in gmake.
The **Makefile** kind is available in Premake 5.0 and later, and are supported for Visual Studio and Codelite.
The **None** kind is available in Premake 5.0 and later, and are supported for gmake, gmake2, Codelite and Visual Studio.
The **Utility** kind is only available for Visual Studio, Codelite and gmake2, as well as very limited support in gmake.
The **SharedItems** kind is only available for Visual Studio 2013 and later.

### Examples ###
Expand Down