<PropertyGroup>
<_symbolExt Condition="'$(OS)' == 'Windows_NT'">$(NativeSymbolExt)</_symbolExt>
<_symbolExt Condition="'$(OS)' != 'Windows_NT'">$(NativeBinaryExt)$(NativeSymbolExt)</_symbolExt>
- </PropertyGroup>
+ <_symbolSourcePath>$(NativeOutputPath)$(TargetName)$(_symbolExt)</_symbolSourcePath>
+ <_symbolTargetPath>$(PublishDir)\$(TargetName)$(_symbolExt)</_symbolTargetPath>
+ <!-- If the symbol is a dsym bundle, it's a folder not a file. -->
+ <_symbolIsFile Condition="'$(_symbolExt)' == '.dsym'">false</_symbolIsFile>
+ <_symbolIsFile Condition="'$(_symbolIsFile)' == ''">true</_symbolIsFile>
+ </PropertyGroup>
- <!-- replace native symbol file if it exists -->
- <Delete Files="$(PublishDir)\$(TargetName)$(_symbolExt)" />
- <Copy SourceFiles="$(NativeOutputPath)$(TargetName)$(_symbolExt)" DestinationFolder="$(PublishDir)"
- Condition="Exists('$(NativeOutputPath)$(TargetName)$(_symbolExt)') and '$(CopyOutputSymbolsToPublishDirectory)' == 'true'" />
+ <ItemGroup>
+ <_symbolRecursivePath Include="$(NativeOutputPath)$(TargetName)$(_symbolExt)/**/*" />
+ </ItemGroup>
+
+ <!-- replace native symbol file if it exists. On Mac, the symbol path may be a folder-->
+ <Delete Files="$(_symbolTargetPath)" Condition="'$(_symbolIsFile)' == 'true' and Exists('$(_symbolTargetPath)')" />
+ <Copy SourceFiles="$(_symbolSourcePath)" DestinationFolder="$(PublishDir)"
+ Condition="'$(_symbolIsFile)' == 'true' and Exists('$(_symbolSourcePath)')" />
+
+ <!-- Copy folder otherwise -->
+ <RemoveDir Directories="$(_symbolTargetPath)" Condition="'$(_symbolIsFile)' == 'false' and Exists('$(_symbolTargetPath)')" />
+ <Copy SourceFiles="@(_symbolRecursivePath)" DestinationFolder="$(_symbolTargetPath)/%(RecursiveDir)"
+ Condition="'$(_symbolIsFile)' == 'false' and Exists('$(_symbolSourcePath)')" />
</Target>
</Project>
<CppCompilerAndLinker Condition="'$(CppCompilerAndLinker)' == ''">clang</CppCompilerAndLinker>
<CppLinker>$(CppCompilerAndLinker)</CppLinker>
<CppLibCreator>ar</CppLibCreator>
- <DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions>
<_SymbolPrefix Condition="'$(_IsApplePlatform)' == 'true'">_</_SymbolPrefix>
<LinkerFlavor Condition="'$(LinkerFlavor)' == '' and '$(_targetOS)' == 'freebsd'">lld</LinkerFlavor>
<LinkerFlavor Condition="'$(LinkerFlavor)' == '' and '$(_linuxLibcFlavor)' == 'bionic'">lld</LinkerFlavor>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' == 'win' and '$(NativeLib)' == 'Static'">.lib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' != 'win' and '$(NativeLib)' == 'Static'">.a</NativeBinaryExt>
- <NativeSymbolExt Condition="'$(_IsApplePlatform)' == 'true'">.dwarf</NativeSymbolExt>
- <NativeSymbolExt Condition="'$(_targetOS)' == 'win'">.pdb</NativeSymbolExt>
- <NativeSymbolExt Condition="'$(_targetOS)' != 'win' and '$(_IsApplePlatform)' != 'true'">.dbg</NativeSymbolExt>
+ <NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_IsApplePlatform)' == 'true'">.dsym</NativeSymbolExt>
+ <NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_targetOS)' == 'win'">.pdb</NativeSymbolExt>
+ <NativeSymbolExt Condition="'$(NativeSymbolExt)' == ''">.dbg</NativeSymbolExt>
<ExportsFileExt Condition="'$(_targetOS)' == 'win'">.def</ExportsFileExt>
<ExportsFileExt Condition="'$(_targetOS)' != 'win'">.exports</ExportsFileExt>
<IlcFrameworkPath>$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)</IlcFrameworkPath>
<IlcFrameworkNativePath>$(MicrosoftNetCoreAppRuntimePackNativeDir)</IlcFrameworkNativePath>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
+ <!-- Use .dwarf files instead of .dsym files since our symbol exporting may not safely handle folders. -->
+ <NativeSymbolExt>.dwarf</NativeSymbolExt>
+ <DsymUtilOptions>--flat</DsymUtilOptions>
</PropertyGroup>
<ItemGroup Condition="'$(NativeAotSupported)' == 'true'">
<CustomNativeMain>true</CustomNativeMain>
<_IsApplePlatform Condition="'$(TargetsAppleMobile)' == 'true'">true</_IsApplePlatform>
<_IsiOSLikePlatform Condition="'$(TargetsAppleMobile)' == 'true'">true</_IsiOSLikePlatform>
- <DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions>
<_SymbolPrefix Condition="'$(_IsApplePlatform)' == 'true'">_</_SymbolPrefix>
</PropertyGroup>