2

I have a solution file K.sln with many projects in it. Using vs2010.

I need to compile only three of those C++ projects, let's say X, Y, Z, T but only for some configurations.

How do I do that?

More in detail, I need to

  • build X in "Debug" configuration only
  • clean Y in "Release" only
  • rebuild T in "Static Debug" only
  • re-link Z in "Release Optim" ony (I can live without knowing this)

Is there a way to do it from a single batch file or a command line, or even better creating a simple appropriate msbuild project file? or both way? Independently from how dependencies are set inside the solution file.

Someone can provide a text of the msbuild project for such simple task?

Is it possible to run these task in parallel?

Lost already enough time looking around and try to implement it, can someone help me? Thanks.

1 Answers1

0

You can setup your msbuild.xml file to do all the operations that you want.

You will need:

Debug or Release configuration to be able to set the target builds you need.

Passing parameters to MSBuild to specify specific targets, like running clean for project "Y" only

Once all the targets and conditionals set you would do something like this:

  <Target Name="MakeMyStuff">
    <CallTarget Targets="DebugX" />
    <CallTarget Targets="ReleaseY" />
    <CallTarget Targets="StaticDebugT" />
    <CallTarget Targets="ReleaseOptimZ" />
  </Target>

After you need to run a command like:

msbuild msbuild.xml /t:MakeMyStuff (/p:BuildCmd=Clean) if you want to add params

or just one specific

msbuild msbuild.xml /t:DebugX

Good luck

Community
  • 1
  • 1
CheGueVerra
  • 7,849
  • 4
  • 37
  • 49