diff options
| author | JassJam <[email protected]> | 2026-02-24 11:06:13 +0000 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-14 00:10:13 +0800 |
| commit | be2de5598c80f9b9960909aa876d4a4e533b9710 (patch) | |
| tree | b388ac0a6f63f55c3e831391a4d2d837aabb8168 | |
| parent | 6fdb4e159d23995e01a676ee9bf754ad171f5afd (diff) | |
fix: fix incremental compilation in C#
| -rw-r--r-- | xmake/rules/csharp/xmake.lua | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
