Skip to content

Commit

Permalink
GMake/Swift: do not link when there is nothing to link
Browse files Browse the repository at this point in the history
This adds a check and early exit before writing the link command
  • Loading branch information
KageKirin committed Dec 10, 2019
1 parent 3544f4d commit ee3fa04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/actions/make/make_swift.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ function swift.file_rules(prj, objfiles)
end

function swift.linker(prj, tool)
local lddeps = make.list(premake.getlinks(prj, "siblings", "fullpath"))
local lddeps = make.list(premake.getlinks(prj, "siblings", "fullpath"))

if #lddeps == 0 and not table.icontains(table.translate(prj.files, path.isswiftfile), true) then
return
end

if prj.kind == "StaticLib" then
_p("$(TARGET): $(OBJECTS) %s ", lddeps)
Expand Down

0 comments on commit ee3fa04

Please sign in to comment.