Skip to content

Commit e4979d1

Browse files
authored
Fix DEBUG not being defined in C# DebugOpt configuration (mono#1908)
1 parent 33a9dea commit e4979d1

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

Directory.Build.props

+14-4
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

-1
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

-1
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/Generator/Generators/MSBuildGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public override void Process()
2424
Write($@"
2525
<Project Sdk=""Microsoft.NET.Sdk"">
2626
<PropertyGroup>
27-
<TargetFramework>netstandard2.0</TargetFramework>
27+
<TargetFramework>netstandard2.1</TargetFramework>
2828
<PlatformTarget>{(Context.TargetInfo.PointerWidth == 64 ? "x64" : "x86")}</PlatformTarget>
2929
<OutputPath>{Options.OutputDir}</OutputPath>
3030
<DocumentationFile>{module.LibraryName}.xml</DocumentationFile>

src/Runtime/CppSharp.Runtime.csproj

+1-2
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)