Skip to content

Commit

Permalink
add more rules
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Mar 30, 2024
1 parent 05a9e17 commit 2b1491a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions xmake/rules/linker/link_scripts/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

2 changes: 1 addition & 1 deletion xmake/rules/platform/windows/def/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions xmake/rules/platform/windows/manifest/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b1491a

Please sign in to comment.