Browse Source

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

pull/1900/head
Jelle 5 months ago committed by GitHub
parent
commit
e4979d185d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      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

12
Directory.Build.props

@ -41,10 +41,15 @@
<RID>$(RID)-$(PlatformTarget)</RID> <RID>$(RID)-$(PlatformTarget)</RID>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(CPPSHARP_RELEASE)' != 'true'"> <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'DebugOpt'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<DefineConstants>DEBUG</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(DotNetCmd)' == 'dotnet' AND $(IsWindows)"> <PropertyGroup Condition="'$(DotNetCmd)' == 'dotnet' AND $(IsWindows)">
@ -56,4 +61,9 @@
<Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFolder="$(PackageDir)ref\$(GlobalTargetFramework)" Condition="'$(ProduceReferenceAssembly)' == 'true' AND '$(RID)' == 'win-x64'" /> <Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFolder="$(PackageDir)ref\$(GlobalTargetFramework)" Condition="'$(ProduceReferenceAssembly)' == 'true' AND '$(RID)' == 'win-x64'" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PackageDir)runtimes\$(RID)\lib\$(GlobalTargetFramework)" /> <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PackageDir)runtimes\$(RID)\lib\$(GlobalTargetFramework)" />
</Target> </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> </Project>

1
src/AST/CppSharp.AST.csproj

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

1
src/Core/CppSharp.csproj

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

2
src/Generator/Generators/MSBuildGenerator.cs

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

3
src/Runtime/CppSharp.Runtime.csproj

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

Loading…
Cancel
Save