summaryrefslogtreecommitdiff
path: root/xmake/rules/csharp/config.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-03-19 23:15:48 +0800
committerruki <[email protected]>2026-03-19 23:15:48 +0800
commit930be83656eb0e6dc968f672e889d43aaa166550 (patch)
tree3628c9923964f6360c531daec57a45812452ecea /xmake/rules/csharp/config.lua
parent879355cb0236593d8b73b4141f547585f37134e0 (diff)
add native aot
Diffstat (limited to 'xmake/rules/csharp/config.lua')
-rw-r--r--xmake/rules/csharp/config.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/rules/csharp/config.lua b/xmake/rules/csharp/config.lua
index e9dbc71e0..e3a728922 100644
--- a/xmake/rules/csharp/config.lua
+++ b/xmake/rules/csharp/config.lua
@@ -45,6 +45,14 @@ function main(target)
target:data_set("csharp.csproj", csprojfile)
+ -- for NativeAOT shared library, export targetfile directly for C/C++ consumers
+ -- dotnet outputs without lib prefix, so we use syslinks with full path
+ local publish_aot = target:values("csharp.publish_aot")
+ if publish_aot and target:is_shared() then
+ target:data_set("inherit.links.deplink", false)
+ target:add("ldflags", target:targetfile(), {interface = true, force = true})
+ end
+
-- add native shared library search paths for P/Invoke
for _, dep in ipairs(target:orderdeps()) do
if dep:is_shared() and not dep:rule("csharp.build") then