question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] CMake build helper should allow selection of host=x64 toolset option

See original GitHub issue

When 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:open
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jasal82commented, Oct 30, 2019

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.

0reactions
memshardedcommented, Apr 29, 2022

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 the settings 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found