From faac0865a79ef38c47bb81d7fa3b42f05ace5538 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 20 Mar 2026 22:08:12 +0800 Subject: fix csharp aot --- xmake/rules/csharp/generator/properties.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xmake/rules/csharp/generator/properties.lua b/xmake/rules/csharp/generator/properties.lua index 0fbab66e3..844c6c0d3 100644 --- a/xmake/rules/csharp/generator/properties.lua +++ b/xmake/rules/csharp/generator/properties.lua @@ -162,6 +162,13 @@ function main() _register_property(register, "include_native_libraries_for_self_extract", "IncludeNativeLibrariesForSelfExtract") _register_property(register, "enable_compression_in_single_file", "EnableCompressionInSingleFile") _register_property(register, "publish_aot", "PublishAot") + -- auto-set NativeLib=Shared when PublishAot is enabled for shared library + register({kind = "property", xml = "NativeLib", resolve = function (context) + local publish_aot = _get_target_value(context.target, "csharp.publish_aot") + if publish_aot and context.target:is_shared() then + return "Shared" + end + end}) _register_property(register, "strip_symbols", "StripSymbols") _register_property(register, "enable_trim_analyzer", "EnableTrimAnalyzer") _register_property(register, "json_serializer_is_reflection_enabled_by_default", "JsonSerializerIsReflectionEnabledByDefault") -- cgit v1.3.1