Skip to content

Commit d39cbbf

Browse files
committed
Fix DEBUG not being defined in C# DebugOpt configuration
1 parent 33a9dea commit d39cbbf

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Directory.Build.props

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,15 @@
4141
<RID>$(RID)-$(PlatformTarget)</RID>
4242
</PropertyGroup>
4343

44-
<PropertyGroup Condition="'$(CPPSHARP_RELEASE)' != 'true'">
45-
<DebugSymbols>true</DebugSymbols>
46-
<DebugType>full</DebugType>
47-
<Optimize>false</Optimize>
44+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
45+
<DebugSymbols>true</DebugSymbols>
46+
<DebugType>full</DebugType>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)' == 'DebugOpt'">
49+
<DebugSymbols>true</DebugSymbols>
50+
<DebugType>full</DebugType>
51+
<Optimize>false</Optimize>
52+
<DefineConstants>DEBUG</DefineConstants>
4853
</PropertyGroup>
4954

5055
<PropertyGroup Condition="'$(DotNetCmd)' == 'dotnet' AND $(IsWindows)">
@@ -56,4 +61,9 @@
5661
<Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFolder="$(PackageDir)ref\$(GlobalTargetFramework)" Condition="'$(ProduceReferenceAssembly)' == 'true' AND '$(RID)' == 'win-x64'" />
5762
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PackageDir)runtimes\$(RID)\lib\$(GlobalTargetFramework)" />
5863
</Target>
64+
65+
<Target Name="ValidateCPPSHARPRelease" BeforeTargets="Build">
66+
<Error Condition="'$(CPPSHARP_RELEASE)' == 'true' AND '$(Configuration)' != 'Release'"
67+
Text="Configuration must be 'Release' when CPPSHARP_RELEASE is 'true'." />
68+
</Target>
5969
</Project>

src/AST/CppSharp.AST.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.1</TargetFramework>
4-
<PlatformTarget>AnyCPU</PlatformTarget>
54
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
65
<IsPackable>true</IsPackable>
76
</PropertyGroup>

src/Core/CppSharp.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.1</TargetFramework>
4-
<PlatformTarget>AnyCPU</PlatformTarget>
54
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
65
<IsPackable>true</IsPackable>
76
</PropertyGroup>

src/Runtime/CppSharp.Runtime.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<PropertyGroup>
33
<LangVersion>7.3</LangVersion>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5-
<TargetFramework>netstandard2.0</TargetFramework>
6-
<PlatformTarget>AnyCPU</PlatformTarget>
5+
<TargetFramework>netstandard2.1</TargetFramework>
76
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
87
<IsPackable>true</IsPackable>
98
</PropertyGroup>

0 commit comments

Comments
 (0)