Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a quick way to switch the solution platform in Visual Studio 2010?

I want to compile my C++ projects in 32-bit and 64-bit mode. Until now, I created Solution Configurations: in addition to the pre-configured "Debug" and "Release" configurations, I then had "Debug x64" and "Release x64" configurations which I set to compile a project for the x64 architecture.

However, my latest project can be changed in a number of dimensions: Not only "Release" vs "Debug" but also "XP", "Server03" and "newer" as well as "EXE" vs "DLL" (it can actually be compiled in both formats). Because this already gives 2*2*3=12 configurations, adding another "x64" configuration for each of those would give the whole thing absurd proportions.

That's why I want to use the Solution Platform setting from now on. Unfortunately, the only way to change that seems to be to click the configuration dropdown list, open the Configuration Manager from there, then change the Solution Platform and click OK. This takes a rather long time (more than doubling the number of clicks). Is there a quicker way? Or alternatively, a better way to manage all the dimensions in which the project can change (which involve project settings and precompiler definitions)?

like image 620
Felix Dombek Avatar asked Oct 10 '22 11:10

Felix Dombek


2 Answers

I'd say that since your build is so complex, a build script would be a better choice to handle all that complexity. You could write the script using MSBuild, NAnt, Rake or whatever you prefer. When you want to build some configuration, or all, you just call the script with the appropiate parameters.

My recommendation: Use the IronRuby-Albacore combo, it's really straightforward and you code your build script in Ruby, which is much more readable than XML. Get started here

like image 157
dario_ramos Avatar answered Oct 19 '22 23:10

dario_ramos


One option is to create a Visual Studio macro and binding it to a either key or a menu item. Once the macro is invoked you can have it iterate through all of the solution platforms and build each one.

like image 35
Captain Obvlious Avatar answered Oct 19 '22 23:10

Captain Obvlious