How to make a visual studio solution with x64/x86 support?

Just like the question says I want to create a visual studio solution that supports both x64/x86.

Is this possible?

Also is it possible to make a singular visual studio solution that supports 2 toolchains?

CMake does not support multiple toolchains in a single build tree, so this is not possible. You’ll need two build trees for this.

1 Like

Opening the CMake source tree directly in Visual Studio 2017 or later can do this. I found it pretty unstable, though.

@hsattler what do you mean “opening the cmake source tree directly in Visual Studio 2017”?

Are you referring to Visual Studios cmake support via CMakeSetttings.json?

1 Like

Yes. That’s currently the only way to have it in one VS solution.

1 Like

I understand for most generators it doesn’t make sense to support multiple toolchains.

However, I think Visual Studio should be the exception. Since most people except to be able to build 32/64 bit application with visual studio.

It’s a fundamental limitation to CMake. What is the value of CMAKE_SYSTEM_PROCESSOR with two toolchains? CMake would need lots of work to support such a workflow.

The generation step creates the solution files. That currently involves exactly one configure step. It could involve two or more.

It probably is still a lot if work but there is no fundamental conflict to the CMake concept.

The current user interface doesn’t fit such a use case though.

Concept? Probably not. Implementation, very much so :slight_smile: .