msbuild
msbuild copied to clipboard
BaseIntermediateOutputPath for C++ projects
Seems like it's not supported for C++ projects.
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.
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.
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..
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.