Skip to content
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

[develop2] change default profile apple-clang to gnu17 #13185

Merged
merged 2 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions conan/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def _conan2_migrate_recipe_msg(exception):
error = "*********************************************************\n" \
f"Recipe '{pkg}' seems broken.\n" \
f"It is possible that this recipe is not Conan 2.0 ready\n"\
"If the recipe comes from ConanCenter check: \n" \
"https://github.com/conan-io/conan-center-index/blob/master/docs/v2_migration.md\n" \
"If the recipe comes from ConanCenter check: https://conan.io/cci-v2.html\n" \
"If it is your recipe, check it is updated to 2.0\n" \
"*********************************************************\n"
ConanOutput().writeln(error, fg=Color.BRIGHT_MAGENTA)
Expand All @@ -190,8 +189,7 @@ def _conan2_migrate_recipe_msg(exception):
error = "*********************************************************\n" \
f"Recipe '{pkg}' cannot build its binary\n" \
f"It is possible that this recipe is not Conan 2.0 ready\n" \
"If the recipe comes from ConanCenter check: \n" \
"https://github.com/conan-io/conan-center-index/blob/master/docs/v2_migration.md\n" \
"If the recipe comes from ConanCenter check: https://conan.io/cci-v2.html\n" \
"If it is your recipe, check it is updated to 2.0\n" \
"*********************************************************\n"
ConanOutput().writeln(error, fg=Color.BRIGHT_MAGENTA)
Expand Down
5 changes: 4 additions & 1 deletion conan/cli/commands/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ def profile_detect(conan_api, parser, subparser, *args):
detected_profile_cli_output(detected_profile)
contents = detected_profile.dumps()
ConanOutput().warning("This profile is a guess of your environment, please check it.")
if detected_profile.settings.get("os") == "Macos":
ConanOutput().warning("Defaulted to cppstd='gnu17' for apple-clang.")
ConanOutput().warning("The output of this command is not guaranteed to be stable and can "
"change in future Conan versions")
"change in future Conan versions.")
ConanOutput().warning("Use your own profile files for stability.")
ConanOutput().success(f"Saving detected profile to {profile_pathname}")
save(profile_pathname, contents)

Expand Down
5 changes: 4 additions & 1 deletion conans/client/conf/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ def _detect_compiler_version(result):

if compiler != "msvc":
cppstd = _cppstd_default(compiler, version)
if compiler == "apple-clang" and version >= "11":
# forced auto-detection, gnu98 is too old
cppstd = "gnu17"
result.append(("compiler.cppstd", cppstd))


Expand Down Expand Up @@ -375,7 +378,7 @@ def _cppstd_default(compiler, compiler_version):
assert isinstance(compiler_version, Version)
default = {"gcc": _gcc_cppstd_default(compiler_version),
"clang": _clang_cppstd_default(compiler_version),
"apple-clang": "gnu98", # Confirmed in apple-clang 9.1 with a simple "auto i=1;"
"apple-clang": "gnu98",
"msvc": _visual_cppstd_default(compiler_version),
"mcst-lcc": _mcst_lcc_cppstd_default(compiler_version)}.get(str(compiler), None)
return default
Expand Down