Skip to content
1 change: 0 additions & 1 deletion eng/testing/tests.android.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
</ItemGroup>
<PropertyGroup Condition="'$(TestNativeAOT)' == 'true'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<_UseNativeLibPrefix>true</_UseNativeLibPrefix>
<_SuppressNativeLibEventSourceWarning>true</_SuppressNativeLibEventSourceWarning>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@
<PropertyGroup Condition="'$(CopyOutputSymbolsToPublishDirectory)' == 'true'">
<_symbolExt Condition="'$(OS)' == 'Windows_NT'">$(NativeSymbolExt)</_symbolExt>
<_symbolExt Condition="'$(OS)' != 'Windows_NT'">$(NativeBinaryExt)$(NativeSymbolExt)</_symbolExt>
<_symbolSourcePath>$(NativeOutputPath)$(TargetName)$(_symbolExt)</_symbolSourcePath>
<_symbolTargetPath>$(PublishDir)\$(TargetName)$(_symbolExt)</_symbolTargetPath>
<_symbolSourcePath>$(NativeOutputPath)$(NativeBinaryPrefix)$(TargetName)$(_symbolExt)</_symbolSourcePath>
<_symbolTargetPath>$(PublishDir)\$(NativeBinaryPrefix)$(TargetName)$(_symbolExt)</_symbolTargetPath>
</PropertyGroup>

<ItemGroup Condition="'$(CopyOutputSymbolsToPublishDirectory)' == 'true'">
<_symbolRecursivePath Include="$(NativeOutputPath)$(TargetName)$(_symbolExt)/**/*" />
<_symbolRecursivePath Include="$(NativeOutputPath)$(NativeBinaryPrefix)$(TargetName)$(_symbolExt)/**/*" />

<!-- Add native symbol file if it exists. On Mac, the symbol path may be a folder-->
<ResolvedFileToPublish Include="$(_symbolSourcePath)"
Condition="'$(NativeSymbolExt)' != '.dSYM' and Exists('$(_symbolSourcePath)')">
<RelativePath>$(TargetName)$(_symbolExt)</RelativePath>
<RelativePath>$(NativeBinaryPrefix)$(TargetName)$(_symbolExt)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>

<!-- Add folder otherwise. If the symbol is a dSYM bundle, it's a folder not a file. -->
<ResolvedFileToPublish Include="@(_symbolRecursivePath)"
Condition="'$(NativeSymbolExt)' == '.dSYM' and Exists('$(_symbolSourcePath)')">
<RelativePath>$(TargetName)$(_symbolExt)/%(RecursiveDir)%(Filename)%(Extension)</RelativePath>
<RelativePath>$(NativeBinaryPrefix)$(TargetName)$(_symbolExt)/%(RecursiveDir)%(Filename)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<TargetTriple Condition="'$(CrossCompileArch)' != '' and '$(_IsAlpineExitCode)' == '0'">$(CrossCompileArch)-alpine-linux-$(CrossCompileAbi)</TargetTriple>
<TargetTriple Condition="'$(CrossCompileArch)' != '' and ($(CrossCompileRid.StartsWith('freebsd')))">$(CrossCompileArch)-unknown-freebsd12</TargetTriple>

<SharedLibraryInstallName Condition="'$(SharedLibraryInstallName)' == '' and '$(_IsApplePlatform)' == 'true' and '$(NativeLib)' == 'Shared'">@rpath/$(TargetName)$(NativeBinaryExt)</SharedLibraryInstallName>
<SharedLibraryInstallName Condition="'$(SharedLibraryInstallName)' == '' and '$(_IsApplePlatform)' == 'true' and '$(NativeLib)' == 'Shared'">@rpath/$(NativeBinaryPrefix)$(TargetName)$(NativeBinaryExt)</SharedLibraryInstallName>

<EventPipeName>libeventpipe-disabled</EventPipeName>
<EventPipeName Condition="'$(EventSourceSupport)' == 'true'">libeventpipe-enabled</EventPipeName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' == 'win' and '$(NativeLib)' == 'Static'">.lib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' != 'win' and '$(NativeLib)' == 'Static'">.a</NativeBinaryExt>

<NativeBinaryPrefix Condition="'$(_UseNativeLibPrefix)' == 'true' and '$(IsNativeExecutable)' != 'true' and '$(_targetOS)' != 'win'">lib</NativeBinaryPrefix>
<NativeBinaryPrefix Condition="'$(UseNativeLibPrefix)' != 'false' and '$(IsNativeExecutable)' != 'true' and '$(_targetOS)' != 'win'">lib</NativeBinaryPrefix>

<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_IsApplePlatform)' == 'true'">.dSYM</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_targetOS)' == 'win'">.pdb</NativeSymbolExt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<AssemblyName>$(LibPrefix)$(MSBuildProjectName)</AssemblyName>
<!-- LibPrefix is baked into AssemblyName because Source-Build uses the NuGet SDK,
which doesn't set NativeBinaryPrefix. Disable UseNativeLibPrefix to prevent
double-prefix when building with local NativeAOT targets (bootstrap). -->
<UseNativeLibPrefix>false</UseNativeLibPrefix>
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
<RootNamespace>Microsoft.Diagnostics.DataContractReader</RootNamespace>
<Nullable>enable</Nullable>
Expand Down
10 changes: 5 additions & 5 deletions src/native/managed/native-library.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
Condition="'$(IsRuntimeComponent)' == 'true' and '$(TargetsWindows)' != 'true'">
<PropertyGroup>
<StrippedOutputPath>$(OutputPath)stripped\</StrippedOutputPath>
<StripSourceFile>$(StrippedOutputPath)$(TargetName)$(NativeBinaryExt)</StripSourceFile>
<StripSourceFile>$(StrippedOutputPath)$(NativeBinaryPrefix)$(TargetName)$(NativeBinaryExt)</StripSourceFile>
<StrippedExt Condition="'$(StrippedExt)' == '' and ('$(TargetsOSX)' == 'true' or '$(TargetsAppleMobile)' == 'true')">.dylib.dwarf</StrippedExt>
<StrippedExt Condition="'$(TargetsUnix)' == 'true' and '$(StrippedExt)' == ''">.so.dbg</StrippedExt>
<StripDestinationFile>$(StrippedOutputPath)$(TargetName)$(StrippedExt)</StripDestinationFile>
<StripDestinationFile>$(StrippedOutputPath)$(NativeBinaryPrefix)$(TargetName)$(StrippedExt)</StripDestinationFile>
</PropertyGroup>
</Target>

Expand Down Expand Up @@ -54,14 +54,14 @@
<Target Name="StripLibraryLikeCoreCLRBuild"
DependsOnTargets="SetupOSSpecificProps;LinkNative;StripLibraryLikeCoreCLRSetupPaths"
Condition="'$(IsRuntimeComponent)' == 'true' and '$(TargetsWindows)' != 'true'"
Inputs="$(NativeOutputPath)$(TargetName)$(NativeBinaryExt)"
Inputs="$(NativeOutputPath)$(NativeBinaryPrefix)$(TargetName)$(NativeBinaryExt)"
Outputs="$(StripSourceFile);$(StripDestinationFile)">
<Error Text="Do not set StripSymbols to true - runtime components stripping is controlled by native-library.targets" Condition="'$(StripSymbols)' == 'true'" />

<Message Importance="Normal" Text="Stripping $(NativeOutputPath)$(TargetName)$(NativeBinaryExt) into $(StripSourceFile) and $(StripDestinationFile)" />
<Message Importance="Normal" Text="Stripping $(NativeOutputPath)$(NativeBinaryPrefix)$(TargetName)$(NativeBinaryExt) into $(StripSourceFile) and $(StripDestinationFile)" />

<!-- copy from the native/ subfolder to the stripped/ subfolder -->
<Copy SourceFiles="$(NativeOutputPath)$(TargetName)$(NativeBinaryExt)"
<Copy SourceFiles="$(NativeOutputPath)$(NativeBinaryPrefix)$(TargetName)$(NativeBinaryExt)"
DestinationFolder="$(StrippedOutputPath)"
SkipUnchangedFiles="true" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<OutputType>Exe</OutputType>
<CustomNativeMain>true</CustomNativeMain>
<NativeLib>Shared</NativeLib>
<UseNativeLibPrefix>false</UseNativeLibPrefix>
<RequiresProcessIsolation>true</RequiresProcessIsolation>
<ReferenceXUnitWrapperGenerator>false</ReferenceXUnitWrapperGenerator>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<CLRTestPriority>0</CLRTestPriority>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NativeLib>Shared</NativeLib>
<UseNativeLibPrefix>false</UseNativeLibPrefix>
<BuildAsStandalone>false</BuildAsStandalone>
<!-- Unable to compile a project with the Library output type for apple mobile devices -->
<CLRTestTargetUnsupported Condition="'$(TargetsAppleMobile)' == 'true'">true</CLRTestTargetUnsupported>
Expand Down
Loading