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

Enable use of std::format for AppleClang / Xcode 16 #659

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

rothmichaels
Copy link
Contributor

@rothmichaels rothmichaels commented Dec 19, 2024

Specified the minimum apple-clang version to support std::format to 16 for connanfile.py. Xcode 16 does include the <format> header but does not seem to have the __cpp_lib_format compatibility macro defined so a similar override was needed as we had for Clang 17.

To be able to use std::format with Xcode 16 I had to pass -DMP_UNITS_API_STD_FORMAT=AUTO when calling cmake. Is this expected or is this a sign I missed something in my changes to CMakeLists.txt?

@mpusz
Copy link
Owner

mpusz commented Dec 19, 2024

To be able to use std::format with Xcode 16 I had to pass -DMP_UNITS_API_STD_FORMAT=AUTO when calling cmake. Is this expected or is this a sign I missed something in my changes to CMakeLists.txt?

Conan should use std::format by default if supported. You can try to force it from the Conan command line with -o '&:std_format=True' and see what happens.

@rothmichaels
Copy link
Contributor Author

To be able to use std::format with Xcode 16 I had to pass -DMP_UNITS_API_STD_FORMAT=AUTO when calling cmake. Is this expected or is this a sign I missed something in my changes to CMakeLists.txt?

Conan should use std::format by default if supported. You can try to force it from the Conan command line with -o '&:std_format=True' and see what happens.

Oh, actually this must have been confusion on my part looking at some of my temporary debug messages while I wile I was editing the CMakeList.txt. -DMP_UNITS_API_STD_FORMAT=AUTO is not needed after all.

Specified the minimum apple-clang version to support `std::format` to 16
for _connanfile.py_.  Xcode 16 does include the `<format>` header but
does not seem to have the __cpp_lib_format compatibility macro defined
so a similar override was needed as we had for Clang 17.

To be able to use `std::format` with Xcode 16 I had to pass
`-DMP_UNITS_API_STD_FORMAT=AUTO` when calling `cmake`.  Is this expected
or is this a sign I missed something in my changes to _CMakeLists.txt_?
@rothmichaels rothmichaels force-pushed the feature/std-format-apple-clang-16 branch from 6504f71 to 43729c6 Compare December 19, 2024 17:54
@mpusz
Copy link
Owner

mpusz commented Dec 19, 2024

generate-job-matrix.py should probably also be updated in line 67. Additionally, could you please also update the table at https://mpusz.github.io/mp-units/latest/getting_started/cpp_compiler_support?

Copy link
Owner

@mpusz mpusz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mpusz mpusz merged commit e3ec5cb into mpusz:master Dec 19, 2024
80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants