-
-
Notifications
You must be signed in to change notification settings - Fork 231
Expand file tree
/
Copy pathSentry.Native.targets
More file actions
119 lines (106 loc) · 7.96 KB
/
Sentry.Native.targets
File metadata and controls
119 lines (106 loc) · 7.96 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<Project>
<PropertyGroup>
<SentryNativeSourceDirectory>$(MSBuildThisFileDirectory)..\..\..\..\modules\sentry-native\</SentryNativeSourceDirectory>
<SentryNativeLibraryName>sentry-native</SentryNativeLibraryName>
<SentryNativeBuildScript>$(MSBuildThisFileDirectory)..\..\..\..\scripts\build-sentry-native.ps1</SentryNativeBuildScript>
<SentryNativeBuildInputs>$(MSBuildThisFileDirectory)..\..\..\..\.git\modules\modules\sentry-native/HEAD;$(MSBuildThisFileDirectory)Sentry.Native.targets;$(SentryNativeBuildScript)</SentryNativeBuildInputs>
<SentryNativeOutputDirectory>$(MSBuildThisFileDirectory)sentry-native\</SentryNativeOutputDirectory>
<!-- List of runtime identifiers: https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json -->
<NativeLibRelativePath-win-x64>win-x64</NativeLibRelativePath-win-x64>
<SentryNativeOutputDirectory-win-x64>$(SentryNativeOutputDirectory)$(NativeLibRelativePath-win-x64)\</SentryNativeOutputDirectory-win-x64>
<NativeLibRelativePath-win-arm64>win-arm64</NativeLibRelativePath-win-arm64>
<SentryNativeOutputDirectory-win-arm64>$(SentryNativeOutputDirectory)$(NativeLibRelativePath-win-arm64)\</SentryNativeOutputDirectory-win-arm64>
<NativeLibRelativePath-linux-x64>linux-x64</NativeLibRelativePath-linux-x64>
<SentryNativeOutputDirectory-linux-x64>$(SentryNativeOutputDirectory)$(NativeLibRelativePath-linux-x64)\</SentryNativeOutputDirectory-linux-x64>
<NativeLibRelativePath-linux-musl-x64>linux-musl-x64</NativeLibRelativePath-linux-musl-x64>
<SentryNativeOutputDirectory-linux-musl-x64>$(SentryNativeOutputDirectory)$(NativeLibRelativePath-linux-musl-x64)\</SentryNativeOutputDirectory-linux-musl-x64>
<NativeLibRelativePath-linux-arm64>linux-arm64</NativeLibRelativePath-linux-arm64>
<SentryNativeOutputDirectory-linux-arm64>$(SentryNativeOutputDirectory)$(NativeLibRelativePath-linux-arm64)\</SentryNativeOutputDirectory-linux-arm64>
<NativeLibRelativePath-linux-musl-arm64>linux-musl-arm64</NativeLibRelativePath-linux-musl-arm64>
<SentryNativeOutputDirectory-linux-musl-arm64>$(SentryNativeOutputDirectory)$(NativeLibRelativePath-linux-musl-arm64)\</SentryNativeOutputDirectory-linux-musl-arm64>
<NativeLibRelativePath-osx>osx</NativeLibRelativePath-osx>
<SentryNativeOutputDirectory-osx>$(SentryNativeOutputDirectory)$(NativeLibRelativePath-osx)\</SentryNativeOutputDirectory-osx>
<SentryNativeBuildOutputs Condition="'$(RuntimeIdentifier)' == 'win-x64'">$(SentryNativeOutputDirectory-win-x64)lib$(SentryNativeLibraryName).lib</SentryNativeBuildOutputs>
<SentryNativeBuildOutputs Condition="'$(RuntimeIdentifier)' == 'win-arm64'">$(SentryNativeOutputDirectory-win-arm64)lib$(SentryNativeLibraryName).lib</SentryNativeBuildOutputs>
<SentryNativeBuildOutputs Condition="'$(RuntimeIdentifier)' == 'linux-x64'">$(SentryNativeOutputDirectory-linux-x64)lib$(SentryNativeLibraryName).a</SentryNativeBuildOutputs>
<SentryNativeBuildOutputs Condition="'$(RuntimeIdentifier)' == 'linux-musl-x64'">$(SentryNativeOutputDirectory-linux-musl-x64)lib$(SentryNativeLibraryName).a</SentryNativeBuildOutputs>
<SentryNativeBuildOutputs Condition="'$(RuntimeIdentifier)' == 'linux-arm64'">$(SentryNativeOutputDirectory-linux-arm64)lib$(SentryNativeLibraryName).a</SentryNativeBuildOutputs>
<SentryNativeBuildOutputs Condition="'$(RuntimeIdentifier)' == 'linux-musl-arm64'">$(SentryNativeOutputDirectory-linux-musl-arm64)lib$(SentryNativeLibraryName).a</SentryNativeBuildOutputs>
<SentryNativeBuildOutputs Condition="$([MSBuild]::IsOsPlatform('OSX'))">$(SentryNativeOutputDirectory-osx)lib$(SentryNativeLibraryName).a</SentryNativeBuildOutputs>
</PropertyGroup>
<!-- Packaging -->
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)buildTransitive\Sentry.Native.targets" Pack="true" PackagePath="buildTransitive\Sentry.Native.targets" />
<None Include="$(MSBuildThisFileDirectory)buildTransitive\Sentry.Native.targets" Pack="true" PackagePath="build\Sentry.Native.targets" />
</ItemGroup>
<!-- Packaging the native library (NOTE: $(RuntimeIdentifier) is not set) -->
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'win-x64'">
<None Include="$(SentryNativeOutputDirectory-win-x64)$(SentryNativeLibraryName).lib">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-win-x64)</PackagePath>
</None>
</ItemGroup>
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'win-arm64'">
<None Include="$(SentryNativeOutputDirectory-win-arm64)$(SentryNativeLibraryName).lib">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-win-arm64)</PackagePath>
</None>
</ItemGroup>
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'linux-x64'">
<None Include="$(SentryNativeOutputDirectory-linux-x64)lib$(SentryNativeLibraryName).a">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-x64)</PackagePath>
</None>
</ItemGroup>
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'linux-musl-x64'">
<None Include="$(SentryNativeOutputDirectory-linux-musl-x64)lib$(SentryNativeLibraryName).a">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-musl-x64)</PackagePath>
</None>
</ItemGroup>
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'linux-arm64'">
<None Include="$(SentryNativeOutputDirectory-linux-arm64)lib$(SentryNativeLibraryName).a">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-arm64)</PackagePath>
</None>
</ItemGroup>
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'linux-musl-arm64'">
<None Include="$(SentryNativeOutputDirectory-linux-musl-arm64)lib$(SentryNativeLibraryName).a">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-musl-arm64)</PackagePath>
</None>
</ItemGroup>
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or $([MSBuild]::IsOsPlatform('OSX'))">
<None Include="$(SentryNativeOutputDirectory-osx)lib$(SentryNativeLibraryName).a">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-osx)</PackagePath>
</None>
</ItemGroup>
<Target Name="CleanNativeSDK" BeforeTargets="CoreClean" Condition="'$(_SentryIsNet8OrGreater)' == 'true'">
<Message Text="Inside Custom Clean" Importance="high"/>
<RemoveDir Directories="$(SentryNativeOutputDirectory)" />
<RemoveDir Directories="$(SentryNativeSourceDirectory)build" />
</Target>
<!-- Build the Sentry Native SDK (this only runs on local machines because in CI we expect the SDK to be
built already on each native platform and fetched for the final .net build. -->
<Target Name="_BuildSentryNativeSDK"
Inputs="$(SentryNativeBuildInputs)"
Outputs="$(SentryNativeBuildOutputs)">
<!-- We want a "-Clean" because if the build script changes, previous cmake cache may contain invalid defines. -->
<Exec Command="pwsh $(SentryNativeBuildScript) -Clean" />
</Target>
<!-- We want to build the sentry-native only once, BEFORE building TFM specific verions of the SDK -->
<!-- How to run a target exactly once: https://learn.microsoft.com/visualstudio/msbuild/run-target-exactly-once-->
<Target Name="_BuildSentryNativeSDKBeforeOuterBuild"
Condition="'$(_SentryIsNet8OrGreater)' == 'true' and '$(CI)' != 'true'"
DependsOnTargets="_BuildSentryNativeSDK"
BeforeTargets="DispatchToInnerBuilds">
</Target>
<Target Name="_BuildSentryNativeSDKBeforeInnerBuild"
Condition="'$(_SentryIsNet8OrGreater)' == 'true' and '$(CI)' != 'true'"
BeforeTargets="BeforeBuild">
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="_BuildSentryNativeSDK"
RemoveProperties="TargetFramework" />
</Target>
</Project>