msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

BaseIntermediateOutputPath for C++ projects

Open kokole opened this issue 8 years ago • 4 comments

Seems like it's not supported for C++ projects.

kokole avatar Jul 16 '17 05:07 kokole

vcxprojs support IntDir for the same purpose, for instance:

<PropertyGroup>
  <OutDir>$(SolutionDir)bin\$(Configuration)\</OutDir>
  <IntDir>$(OutDir)obj\</IntDir>
</PropertyGroup>

In csproj, fsproj and vbproj etc., if we try to use these, they get overridden by the commons. The consumer-facing properties are OutputDir and BaseIntermediateOutputPath.

Though not a show-stopper, it would be nice to have unified syntax across the board: either OutputDir / BaseIntermediateOutputPath or the shorter ones; OutDir / IntDir.

am11 avatar Jul 25 '17 00:07 am11

We could use IntDir and OutDir internally and use OutputPath properties as user facing ones.

I think NETFX 2.0 targets had IntDir instead of IntermediateOutputPath.

Nirmal4G avatar Aug 22 '20 11:08 Nirmal4G

The problem still exists on VS 2022, I debugged with this for hours, and found the definition in Microsoft/VC/v170/Microsoft.Cpp.MSVC.Toolset.Common.props

<IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'!=''">$(IntermediateOutputPath)</IntDir>
<IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'=='' and '$(Platform)' == 'Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'=='' and '$(Platform)' != 'Win32'">$(Platform)\$(Configuration)\</IntDir>

Before this, there is no process from BaseIntermediateOutputPath to IntermediateOutputPath. And I found no helpful pages in MSDN..

puxu-msft avatar Sep 30 '21 10:09 puxu-msft

VC Team should update their targets to remove usages of IntermediateOutputPath! This property is no longer present in Common props. The BaseIntermediateOutputPath is in Common props but I'm proposing to it move it into targets and replace it with a common BuildDir since we already have a PublishDir (should be promoted to top-level folder instead!). This will be a breaking change but one that I think is beneficial in the long run.

Nirmal4G avatar Jun 28 '22 12:06 Nirmal4G