summaryrefslogtreecommitdiff
path: root/xmake/rules
diff options
context:
space:
mode:
authorruki <[email protected]>2024-03-31 18:33:25 +0800
committerGitHub <[email protected]>2024-03-31 18:33:25 +0800
commitcec09d4b59cb5b872bb91469a9bfaa731eff77dd (patch)
tree38ecec3fc91ce6e51d464df41469d8e13919c40f /xmake/rules
parent073bd32b3d0fc31246a8708d59a3b277606db3bd (diff)
parent2b1491a54695612af04e79b24b38c2da2f794e16 (diff)
Merge pull request #4904 from xmake-io/def
Fix incremental compilation for .def files
Diffstat (limited to 'xmake/rules')
-rw-r--r--xmake/rules/linker/link_scripts/xmake.lua2
-rw-r--r--xmake/rules/platform/windows/def/xmake.lua2
-rw-r--r--xmake/rules/platform/windows/manifest/xmake.lua1
3 files changed, 5 insertions, 0 deletions
diff --git a/xmake/rules/linker/link_scripts/xmake.lua b/xmake/rules/linker/link_scripts/xmake.lua
index fdd714988..34bbc3f4f 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 8aaac52d6..9bdcdc874 100644
--- a/xmake/rules/platform/windows/def/xmake.lua
+++ b/xmake/rules/platform/windows/def/xmake.lua
@@ -37,7 +37,9 @@ rule("platform.windows.def")
if target:is_plat("windows") then
flag = "/def:" .. flag
end
+ -- https://github.com/xmake-io/xmake/pull/4901
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 8d24ced97..6bde53a3d 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