-
-
Notifications
You must be signed in to change notification settings - Fork 230
Expand file tree
/
Copy pathSentry.Native.targets
More file actions
58 lines (51 loc) · 3.17 KB
/
Sentry.Native.targets
File metadata and controls
58 lines (51 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!--
This is run during consumer build and:
- generates direct PInvoke
- links sentry-native library statically
- links sentry-native dependencies
See https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/interop for more details.
Note:Target framework conditions should be kept synchronized with src/Sentry/buildTransitive/Sentry.Native.targets -->
<Project>
<ItemGroup>
<!-- When user sets <SentryNative>false</SentryNative> or <SentryNative>disable</SentryNative> in their project -->
<!-- SentryNative.IsEnabled should result in compile-time constant for trimmed applications -->
<!-- Effectively disabling native library -->
<RuntimeHostConfigurationOption Include="Sentry.Native.IsEnabled"
Condition="'$(SentryNative)' != 'false' and '$(SentryNative)' != 'disable'"
Value="true"
Trim="true" />
</ItemGroup>
<PropertyGroup>
<!-- net8.0 or greater -->
<FrameworkSupportsNative Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) and ('$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe')">true</FrameworkSupportsNative>
<!-- Make it opt-out -->
<FrameworkSupportsNative Condition="'$(SentryNative)' == 'false' or '$(SentryNative)' == 'disable'">false</FrameworkSupportsNative>
</PropertyGroup>
<ItemGroup Condition="'$(FrameworkSupportsNative)' == 'true' and ('$(RuntimeIdentifier)' == 'win-x64' or '$(RuntimeIdentifier)' == 'win-arm64')">
<DirectPInvoke Include="sentry-native" />
<NativeLibrary Include="$(MSBuildThisFileDirectory)..\sentry-native\$(RuntimeIdentifier)\sentry-native.lib" />
<NativeLibrary Include="dbghelp.lib" />
<NativeLibrary Include="winhttp.lib" />
<NativeLibrary Include="Gdi32.lib" />
</ItemGroup>
<ItemGroup Condition="'$(FrameworkSupportsNative)' == 'true' and '$(RuntimeIdentifier)' == 'linux-x64'">
<DirectPInvoke Include="sentry-native" />
<NativeLibrary Include="$(MSBuildThisFileDirectory)..\sentry-native\linux-x64\libsentry-native.a" />
<!-- See: https://github.com/dotnet/runtime/issues/97414 -->
<NativeSystemLibrary Include="curl" />
</ItemGroup>
<ItemGroup Condition="'$(FrameworkSupportsNative)' == 'true' and '$(RuntimeIdentifier)' == 'linux-musl-x64'">
<DirectPInvoke Include="sentry-native" />
<!-- When musl is detected, static sentry-native links to static libunwind -->
<LinkerArg Include="-Wl,-Bstatic -Wl,--whole-archive -lunwind -Wl,--no-whole-archive -Wl,-Bdynamic" />
<NativeSystemLibrary Include="lzma" />
<NativeLibrary Include="$(MSBuildThisFileDirectory)..\sentry-native\linux-musl-x64\libsentry-native.a" />
<!-- See: https://github.com/dotnet/runtime/issues/97414 -->
<NativeSystemLibrary Include="curl" />
</ItemGroup>
<ItemGroup Condition="'$(FrameworkSupportsNative)' == 'true' and ('$(RuntimeIdentifier)' == 'osx-x64' or '$(RuntimeIdentifier)' == 'osx-arm64')">
<DirectPInvoke Include="sentry-native" />
<NativeLibrary Include="$(MSBuildThisFileDirectory)..\sentry-native\osx\libsentry-native.a" />
<NativeSystemLibrary Include="curl" />
</ItemGroup>
</Project>