diff --git a/xmake/rules/linker/link_scripts/xmake.lua b/xmake/rules/linker/link_scripts/xmake.lua index fdd7149885..34bbc3f4fd 100644 --- a/xmake/rules/linker/link_scripts/xmake.lua +++ b/xmake/rules/linker/link_scripts/xmake.lua @@ -42,8 +42,10 @@ rule("linker.link_scripts") if target:has_tool("ld", "gcc", "gxx", "clang", "clangxx") or target:has_tool("sh", "gcc", "gxx", "clang", "clangxx") then target:add(target:is_shared() and "shflags" or "ldflags", "-T " .. scriptfile, {force = true}) + target:data_add("linkdepfiles", scriptfile) elseif target:has_tool("ld", "ld") or target:has_tool("sh", "ld") then target:add(target:is_shared() and "shflags" or "ldflags", "-T " .. scriptfile, {force = true}) + target:data_add("linkdepfiles", scriptfile) end end) diff --git a/xmake/rules/platform/windows/def/xmake.lua b/xmake/rules/platform/windows/def/xmake.lua index 5d1957b0bd..9bdcdc8747 100644 --- a/xmake/rules/platform/windows/def/xmake.lua +++ b/xmake/rules/platform/windows/def/xmake.lua @@ -38,8 +38,8 @@ rule("platform.windows.def") flag = "/def:" .. flag end -- https://github.com/xmake-io/xmake/pull/4901 - target:data_add("linkdepfiles", sourcefile) target:add("shflags", flag, {force = true}) + target:data_add("linkdepfiles", sourcefile) break; end end diff --git a/xmake/rules/platform/windows/manifest/xmake.lua b/xmake/rules/platform/windows/manifest/xmake.lua index 8d24ced973..6bde53a3d5 100644 --- a/xmake/rules/platform/windows/manifest/xmake.lua +++ b/xmake/rules/platform/windows/manifest/xmake.lua @@ -34,6 +34,7 @@ rule("platform.windows.manifest") for _, sourcefile in ipairs(sourcebatch.sourcefiles) do target:add("ldflags", "/manifestinput:" .. path.translate(sourcefile), {force = true}) target:add("shflags", "/manifestinput:" .. path.translate(sourcefile), {force = true}) + target:data_add("linkdepfiles", sourcefile) manifest = true local content = io.readfile(sourcefile) if content then