make use of nativeaot static linking feature
See original GitHub issueIs your feature request related to a problem? Please describe.
it is now possible to static link native libraries inside the main binary so it should be possible to do that to the 2 native dlls from avalonia’s native aot output, namely libHarfBuzzSharp.dll
and libSkiaSharp.dll
.
Describe the solution you’d like
include the static library files of those 2 dlls instead and use DirectPInvoke
and NativeLibrary
.
Additional context https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/interop.md#linking
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:35 (13 by maintainers)
Top Results From Across the Web
NativeAOT is one of the most important feature C# needed ...
Static linking does not allow the user access to that "freedom", so the whole binary becomes "infected" and must be open sourced.
Read more >Static libraries
So we need to add a bunch of static libraries to our link. When Native AOT building a dynamic library, this chore is...
Read more >Native code interop with native AOT - .NET
To statically link against an unmanaged library, you need to specify <NativeLibrary Include="filename" /> pointing to a .lib file on Windows and ...
Read more >[NET 7] NativeAOT-compiled static library is not exporting ...
I am trying to compile my managed code into a static library (.lib file on win-x64), so I can link against it from...
Read more >Can a static library be linked to a .NET AOT compiled ...
This is our C# application. External functions to be linked statically are declared like normal P/Invoke functions. using System.Runtime.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It should be optional, as it works only with native AOT. I suppose ideal plan would be something like:
you can build skia for other platforms if you look inside the
cake
files. here is the ones for windows that i use as reference: https://github.com/mono/SkiaSharp/blob/main/native/windows/build.cakefor harfbuzz you can use this and open in visual studio. there is some settings to change to enable static build but i forgot which: https://github.com/mono/SkiaSharp/tree/main/native/windows/libHarfBuzzSharp
reference about the build commands: https://github.com/mono/SkiaSharp/wiki/Building-on-Linux