From be2de5598c80f9b9960909aa876d4a4e533b9710 Mon Sep 17 00:00:00 2001 From: JassJam <0139ne@gmail.com> Date: Tue, 24 Feb 2026 11:06:13 +0000 Subject: fix: fix incremental compilation in C# --- xmake/rules/csharp/xmake.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xmake/rules/csharp/xmake.lua b/xmake/rules/csharp/xmake.lua index 88f235ae1..11aa82347 100644 --- a/xmake/rules/csharp/xmake.lua +++ b/xmake/rules/csharp/xmake.lua @@ -201,6 +201,10 @@ rule("csharp.build") local csprojfile = csprojfiles[1] local csprojabs = path.is_absolute(csprojfile) and csprojfile or path.absolute(csprojfile, os.projectdir()) assert(os.isfile(csprojabs), "target(%s): csharp .csproj not found: %s", target:name(), csprojfile) + + if not target:get("filename") and not target:get("basename") then + target:set("basename", path.basename(csprojabs)) + end target:data_set("csharp.csproj", csprojabs) end) @@ -239,6 +243,8 @@ rule("csharp.build") local targetfile = target:targetfile() if targetfile then + local sourcefiles = target:sourcefiles() + batchcmds:add_depfiles(sourcefiles) batchcmds:set_depmtime(os.mtime(targetfile)) batchcmds:set_depcache(target:dependfile(targetfile)) end -- cgit v1.3.1