summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-03-16 23:56:29 +0800
committerruki <[email protected]>2026-03-16 23:56:29 +0800
commit0f22c796d88325884e568fbe5a559323ba862fe9 (patch)
treeefb0eb362e3f88a3a39ea3300c2deea43c2db5e4
parent0b6dfe22a3a5e2e0d305b3cea78f524812238fe7 (diff)
fix some csproj refs again
-rw-r--r--xmake/rules/csharp/modules/csharp_utils.lua7
-rw-r--r--xmake/rules/csharp/modules/itemgroups.lua8
2 files changed, 5 insertions, 10 deletions
diff --git a/xmake/rules/csharp/modules/csharp_utils.lua b/xmake/rules/csharp/modules/csharp_utils.lua
index 6d19b39b7..404be965d 100644
--- a/xmake/rules/csharp/modules/csharp_utils.lua
+++ b/xmake/rules/csharp/modules/csharp_utils.lua
@@ -59,15 +59,12 @@ function _map_rid_arch(arch)
return nil
end
-function generate_csproj_file(target, opt)
+function generate_csproj_file(target)
if not _is_csharp_target(target) then
return nil
end
local csprojfile = _generated_csproj_path(target)
- generate_csproj(target, csprojfile, table.join(opt or {}, {
- is_csharp_target = _is_csharp_target,
- generate_csproj_file = generate_csproj_file
- }))
+ generate_csproj(target, csprojfile)
target:data_set("csharp.csproj", csprojfile)
return csprojfile
end
diff --git a/xmake/rules/csharp/modules/itemgroups.lua b/xmake/rules/csharp/modules/itemgroups.lua
index b03110ea9..e9367f96f 100644
--- a/xmake/rules/csharp/modules/itemgroups.lua
+++ b/xmake/rules/csharp/modules/itemgroups.lua
@@ -41,11 +41,9 @@ end
function _collect_project_references(context)
local references = {}
for _, dep in ipairs(context.target:orderdeps()) do
- if context.opt.is_csharp_target and context.opt.is_csharp_target(dep) then
- local depcsproj = context.opt.generate_csproj_file and context.opt.generate_csproj_file(dep)
- if depcsproj then
- table.insert(references, _normalize_relative(context.csprojdir, depcsproj))
- end
+ local depcsproj = dep:data("csharp.csproj")
+ if depcsproj then
+ table.insert(references, _normalize_relative(context.csprojdir, depcsproj))
end
end
table.sort(references)