Skip to content

VS: Add compile properties to .NET Sdk projects

This change adds csharp compile properties to the "Configuration" part of a Sdk-style csproj generation by propagating flags gathered in clOptions. It adds DefineConstants that was needed to support target_compile_definitions.

Before

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <OutputPath>path\to\objdir</OutputPath>
</PropertyGroup>

After

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <OutputPath>path\to\objdir</OutputPath>
    <DebugType>full</DebugType>
    <DefineConstants>DEBUG;ADEFINITION</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <LangVersion>10</LangVersion>
    <Optimize>false</Optimize>
    <WarningLevel>3</WarningLevel>
  </PropertyGroup>

Closes: #23376 (closed)
Issue: #23190

Edited by Brad King

Merge request reports