New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake presets with VS and ninja and improved merge #11666
cmake presets with VS and ninja and improved merge #11666
Conversation
Co-authored-by: James <james@conan.io>
…to feature/presets_schema_2
… into feature/cmake_presets_ninja
… into feature/cmake_presets_ninja
from conans.errors import ConanException | ||
from conans.util.files import save, load | ||
|
||
|
||
def _add_build_preset(conanfile, multiconfig): | ||
def _build_preset(conanfile, multiconfig): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is only a rename
@@ -42,7 +43,7 @@ def _configure_preset_name(conanfile, multiconfig): | |||
return str(build_type).lower() | |||
|
|||
|
|||
def _add_configure_preset(conanfile, generator, cache_variables, toolchain_file, multiconfig): | |||
def _configure_preset(conanfile, generator, cache_variables, toolchain_file, multiconfig): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename only
if b["name"] == new_build_preset_name]) | ||
if not already_exist: | ||
data["buildPresets"].append(_add_build_preset(conanfile, multiconfig)) | ||
build_preset = _build_preset(conanfile, multiconfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The below code was a bug, previously I only appended a preset if it didn't exist, but it might be changed, it is needed to overwrite it, so now I search the index and update.
Changelog: Feature: The
CMakePreset.json
now containstoolset
andarchitecture
items when usingNinja
generator andmsvc
compiler so the IDE (Visual Studio) can set the correct compiler (vcvars) automatically.Docs: omit
Close #11623