Skip to content

Commit

Permalink
Add premake.projectdoeslink() to check if a project actually has some…
Browse files Browse the repository at this point in the history
…thing to link
  • Loading branch information
KageKirin committed Feb 28, 2020
1 parent 816e148 commit 28b4890
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/base/project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,23 @@
end


--
-- Checks if the project has something to link
--

function premake.projectdoeslink(prj, cfgname, platform)
local prjcfg = premake.getconfig(prj, cfgname, platform)
local lnkobj = table.icontains(table.translate(prjcfg.files, path.issourcefile), true)
local lnkdep = false
if prj.kind ~= 'StaticLib' then
lnkdep = table.icontains(table.translate(prjcfg.links, function(lnk)
local link = premake.findproject(lnk)
return premake.projectdoeslink(link, cfgname, platform)
end), true)
end
return lnkobj or lnkdep
end


--
-- Gets the name style for a configuration, indicating what kind of prefix,
Expand Down

0 comments on commit 28b4890

Please sign in to comment.