msbuild script unable to build specific build config of C++ Builder 2010 project

301 Views Asked by At

I have a project group in C++ Builder 2010. It contains several projects. One of these projects has, besides Debug and Releae, a Demo build configuration that is a child of the Release one.

The issue I run into is that if I run this from the build script we have, calling the project group file and telling it I want to build using the Demo configuration I get an error about unresolved WinMain. I get the same error by using a build configuration name that does not exist. So my initial thought was that this had to be due to the fact that the other projects in the project group didn't have a Demo configuration. But when I tried running msbuild against the project group file from cmd passing it Demo it built just fine.

C:\src\foo\AutoBuild> msbuild ..\foo.groupproj /t:build /p:Configuration=Demo

The same goes for building the specific project using msbuild from cmd. I have checked that the Config/*Configuration* property is carried over through each <msbuild /> task call and it is.

Hacking the project group (.groupproj) file and forcing it to run Demo for the project in question when running Release also worked.

...

<Target Name="Foo:Make">
  <MSBuild Targets="Make" Projects="Foo.cbproj" Properties="Config=Demo"/>
</Target>

...

Any idea what could be causing this?

Update

Also, by running only the specific project in the main build script when Demo is selected it also works fine. Note that the Release build has been built by the build script prior to this.

<Target Name="Foo:Build">

...

  <MSBuild Condition="$(Configuration)==''" Targets="Make" Projects="..\Server\Bar.groupproj" Properties="Config=Release" />
  <MSBuild Condition="$(Configuration)==''" Targets="Foo" Projects="..\Server\Bar.groupproj" Properties="Config=Demo" />

...

</Target>
0

There are 0 best solutions below