views:

38

answers:

1

I have Visual C++ solution. One of the project needs to compiled targeting x86 as well as x64. With default setting it can be compiled once in solution file. Is it possible to build solution once but build the same project with two different settings ?

Thanks in advance for any help.

+2  A: 

Visual Studio uses a Configuration Manager for this very problem. Right click your project, hit "Properties" and you'll see the Configuration Manager button at the top of the window that pops up. Add a new solution platform (x64) and you'll be good to go.

I typically use Property Sheets to define certain things for the project compilation (defining _X64 in 64-bit compilation, setting the output directory to $(SolutionDir)../../bin/$(Configuration)/$(PlatformName)/$(ProjectName)/).

Travis Gockel
@Travis: I know how to configure x64 target. But here i have limitation from single solution file i need to produce two dll of same project targeting x86 and x64, that too building only once.
Unicorn
Can't you use "Batch build" (under the Build menu)?
Matteo Italia
@Unicorn: What Matteo said should work. Just select Build > Batch Build and pick what you need to do at the same time.
Travis Gockel
Solved this problem creating another solution configuration and making sure only one project gets build in that.Thanks for the help !!
Unicorn