[feature] CMake build helper should allow selection of host=x64 toolset option
See original GitHub issueWhen building with CMake and the Visual Studio generator it is necessary to pass the toolset option host=x64
to CMake so that Visual Studio uses the 64bit compiler/linker executables. It is not an implicit choice by VS, it always selects the 32bit executables if not instructed otherwise. Currently we have to configure that in the recipes because Conan does not support this setting in the toolset attribute:
cmake = CMake(self)
args = None
if self.settings.os == "Windows":
args = ["-T", "host=x64"]
cmake.configure(args=args)
This should be a separate selectable option on the build helper and the default for x86_64 hosts.
Environment Details (include every applicable attribute)
- Windows 10
- Visual Studio 2015
- Conan version: 1.19.2
- Python version: 3.7.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
User Interaction Guide — CMake 3.25.1 Documentation
The ccmake(1) and cmake-gui(1) tools guide the user through setting the various necessary options. The cmake(1) tool can be invoked to specify options...
Read more >Visual Studio 16 2019 — CMake 3.25.1 Documentation
The CMAKE_GENERATOR_TOOLSET option may be set, perhaps via the cmake -T option, to specify another toolset. For each toolset that comes with this...
Read more >CMake 3.25.1 Documentation
Optionally use cmake to Build a Project, Install a Project or just run the corresponding build tool (e.g. make ) directly. cmake can...
Read more >Visual Studio 17 2022 — CMake 3.25.1 Documentation
Toolset Selection ¶. The v143 toolset that comes with VS 17 2022 is selected by default. The CMAKE_GENERATOR_TOOLSET option may ...
Read more >CMake does not find Visual C++ compiler - Stack Overflow
Run Cmake.exe; Proceed as usual to select build and source folder; Select the appropriate Visual Studio compiler and hit the configure button. Hopefully...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I agree, it’s probably not a bug. There should still be a way of selecting the host tool architecture from the profile or the CMake build helper. So that would be the feature request then.
Hi @cedriclaplace
As your comments have different base from the above, as they are using the new build system integrations, I think it is best if you posted a new issue with this. Also, I would strongly recommend to try to reproduce starting with the
conan new hello/0.1 --template=cmake_lib
. There might be something missing to opt-in/out into which compiler and linker you invoke, irrespective of thesettings
one (the host architecture), so I would also recommend to use the--profile:build
to specify the architecture of the host, as by default it would make sense to use it. If not enough, then that might mean that we need to add a conf to be able to select this.