Browse Source

Fix `DEBUG` not being defined in C# `DebugOpt` configuration (#1908)

pull/1900/head
Jelle 3 months ago committed by GitHub
parent
commit
e4979d185d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 18
      Directory.Build.props
  2. 1
      src/AST/CppSharp.AST.csproj
  3. 1
      src/Core/CppSharp.csproj
  4. 2
      src/Generator/Generators/MSBuildGenerator.cs
  5. 3
      src/Runtime/CppSharp.Runtime.csproj

18
Directory.Build.props

@ -41,10 +41,15 @@ @@ -41,10 +41,15 @@
<RID>$(RID)-$(PlatformTarget)</RID>
</PropertyGroup>
<PropertyGroup Condition="'$(CPPSHARP_RELEASE)' != 'true'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'DebugOpt'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(DotNetCmd)' == 'dotnet' AND $(IsWindows)">
@ -56,4 +61,9 @@ @@ -56,4 +61,9 @@
<Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFolder="$(PackageDir)ref\$(GlobalTargetFramework)" Condition="'$(ProduceReferenceAssembly)' == 'true' AND '$(RID)' == 'win-x64'" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PackageDir)runtimes\$(RID)\lib\$(GlobalTargetFramework)" />
</Target>
<Target Name="ValidateCPPSHARPRelease" BeforeTargets="Build">
<Error Condition="'$(CPPSHARP_RELEASE)' == 'true' AND '$(Configuration)' != 'Release'"
Text="Configuration must be 'Release' when CPPSHARP_RELEASE is 'true'." />
</Target>
</Project>

1
src/AST/CppSharp.AST.csproj

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<IsPackable>true</IsPackable>
</PropertyGroup>

1
src/Core/CppSharp.csproj

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<IsPackable>true</IsPackable>
</PropertyGroup>

2
src/Generator/Generators/MSBuildGenerator.cs

@ -24,7 +24,7 @@ namespace CppSharp.Generators @@ -24,7 +24,7 @@ namespace CppSharp.Generators
Write($@"
<Project Sdk=""Microsoft.NET.Sdk"">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<PlatformTarget>{(Context.TargetInfo.PointerWidth == 64 ? "x64" : "x86")}</PlatformTarget>
<OutputPath>{Options.OutputDir}</OutputPath>
<DocumentationFile>{module.LibraryName}.xml</DocumentationFile>

3
src/Runtime/CppSharp.Runtime.csproj

@ -2,8 +2,7 @@ @@ -2,8 +2,7 @@
<PropertyGroup>
<LangVersion>7.3</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>netstandard2.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<TargetFramework>netstandard2.1</TargetFramework>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<IsPackable>true</IsPackable>
</PropertyGroup>

Loading…
Cancel
Save