Skip to content

Commit

Permalink
skip locals init
Browse files Browse the repository at this point in the history
  • Loading branch information
mgravell committed Nov 16, 2020
1 parent 481f3d8 commit 17c0214
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Dapper.StrongName/Dapper.StrongName.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
<TargetFrameworks>net461;netstandard2.0;net5.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>

<DefineConstants Condition=" '$(TargetFramework)' == 'net5.0'">$(DefineConstants);PLAT_NO_REMOTING</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
<Compile Include="..\Dapper\**\*.cs" Exclude="..\Dapper\obj\**\*.cs" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0'">
<DefineConstants>$(DefineConstants);PLAT_NO_REMOTING;PLAT_SKIP_LOCALS_INIT</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
</ItemGroup>
Expand Down
10 changes: 8 additions & 2 deletions Dapper/Dapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
<Description>A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..</Description>
<Authors>Sam Saffron;Marc Gravell;Nick Craver</Authors>
<TargetFrameworks>net461;netstandard2.0;net5.0</TargetFrameworks>
<DefineConstants Condition=" '$(TargetFramework)' == 'net5.0'">$(DefineConstants);PLAT_NO_REMOTING</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0'">
<DefineConstants>$(DefineConstants);PLAT_NO_REMOTING;PLAT_SKIP_LOCALS_INIT</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions Dapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

#if PLAT_SKIP_LOCALS_INIT
[module: System.Runtime.CompilerServices.SkipLocalsInit]
#endif

0 comments on commit 17c0214

Please sign in to comment.