You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't terribly useful right now, but will become useful once the .NET SDK gains full support for Apple platforms like iOS and watchOS that only support static linking.
This will require significant work in Zig, especially for cross-compilation.
As far as how this should work from the user perspective, I think there should just be an MSBuild property that informs the SDK which kind of library to build. NativeAOT has already introduced the NativeLib property for this; the name is a bit unfortunate, but there is probably value in standardizing on it. It accepts Shared (default) and Static. We might extend it to also accept Both.
This is complicated somewhat by needing to invoke zig ar/zig lib to actually create the static library for C/C++ projects. For Zig code, zig build-lib -static takes care of it automatically.
This is complicated somewhat by needing to invoke zig ar/zig lib to actually create the static library for C/C++ projects. For Zig code, zig build-lib -static takes care of it automatically.
Activity
alexrp commentedon Apr 30, 2024
As far as how this should work from the user perspective, I think there should just be an MSBuild property that informs the SDK which kind of library to build. NativeAOT has already introduced the
NativeLibproperty for this; the name is a bit unfortunate, but there is probably value in standardizing on it. It acceptsShared(default) andStatic. We might extend it to also acceptBoth.alexrp commentedon Nov 28, 2024
This is complicated somewhat by needing to invoke
zig ar/zig libto actually create the static library for C/C++ projects. For Zig code,zig build-lib -statictakes care of it automatically.alexrp commentedon Oct 2, 2026
#313