7

Greetings all,

I'm working with a C# solution in VS 2010. Right now, since I'm targeting AnyCPU, when I want to build my installer, I can just select Release mode and hit build and everything is done for me. However, pretty soon I'm going to have to add a C++ DLL project to the solution to accomplish some low-level stuff. To avoid having two different download links for x86 and x64, I'd like to include both builds in my installer. But, it will be very annoying if I have to have separate configurations for x86 and x64. I'll have to build one, then the other, then package it up. Is there some way I can get Visual Studio to compile both the x86 and x64 builds of the C++ project as part of Release mode?

Paul Accisano
  • 1,416
  • 1
  • 14
  • 25
  • See also: http://stackoverflow.com/questions/1574075/use-a-single-visual-studio-solution-to-build-both-x86-and-x64-at-the-same-time – RikRak Jul 26 '11 at 14:13

3 Answers3

3

Well, I found a solution. Just make two projects, one for x86 build and one for x64 build, referencing the same source files. It's ugly, but it works.

Paul Accisano
  • 1,416
  • 1
  • 14
  • 25
0

Just add executing command to build such configuration in PostBuild event of C++ DLL project. Use macroses and help of "devenv /?".

AFAIR e.g.:

devenv $(SolutionName) /project $(ProjectName) /ProjectConfig "Release|x64"
Robert
  • 5,278
  • 43
  • 65
  • 115
Кое Кто
  • 445
  • 5
  • 9
0

I think that you will have to manually edit the proj files to ensure that the msbuild instructions are correct. I suspect it's not a hard job.

Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
  • I've tried editing the solution file's `GlobalSection(ProjectConfigurationPlatforms) = postSolution` section; this doesn't work. It just compiles the first configuration listed and ignores any subsequent listings. – Paul Accisano Sep 03 '10 at 01:42