From ee3fa0424a7b15127d9c5629d30dc113240ff38e Mon Sep 17 00:00:00 2001 From: KageKirin Date: Tue, 10 Dec 2019 15:15:26 +0900 Subject: [PATCH] GMake/Swift: do not link when there is nothing to link This adds a check and early exit before writing the link command --- src/actions/make/make_swift.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/actions/make/make_swift.lua b/src/actions/make/make_swift.lua index 3302c623..3ee680e3 100644 --- a/src/actions/make/make_swift.lua +++ b/src/actions/make/make_swift.lua @@ -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)