-
Notifications
You must be signed in to change notification settings - Fork 990
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
[question] How to validate cppstd and compiler for header-only packages? #12210
Milestone
Comments
uilianries
changed the title
[question] How to validate cppstd for header-only packages?
[question] How to validate cppstd and compiler for header-only packages?
Sep 28, 2022
4 tasks
I have created a PR to the docs clarifying this case. As there still some uncertainties around how to manage cppstd, using |
4 tasks
4 tasks
dvirtz
added a commit
to dvirtz/conan-center-index
that referenced
this issue
Nov 3, 2022
Will be closed by #12555 |
Closed by #12555, will be in beta.6 And for 1.55 the approach is: use self.settings in validate(), not self.info.settings |
conan-center-bot
pushed a commit
to conan-io/conan-center-index
that referenced
this issue
Nov 28, 2022
* polymorphic_value: conan v2 support done as part of @prince-chrismc's webinar * apply review suggestions * work around self.info being already cleared see conan-io/conan#12210 * use conan.tools.build.can_run * Revert "work around self.info being already cleared" This reverts commit 84f85e4. * Apply suggestions from code review Co-authored-by: Uilian Ries <uilianries@gmail.com> * align test package to templates Co-authored-by: Uilian Ries <uilianries@gmail.com>
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the new validate approach recommended by the migration guide, we should use
self.info.settings
instead ofself.settings
as in the past. Also, for header-only projects, we should consider self.info.clear() instead ofself.info.header_only()
However, we have cases where we need to check the cppstd or even the compiler version to be sure that's is enough, for instance:
This is a very regular header-only recipe from CCI. The important thing here is: it requires C++17, and at least some new compiler version.
When using the new
self.info.clear
, thenself.info.settings.compiler
will no longer exist when runningconan create
which is fine, since we are only copying files to the package. However, when runningconan install
to get that pre-built package, the same occurs, because the package ID is unique, so the user will not check that validate and eventually will fail during the compilation due an older and incompatible compiler.So the question is, how to validate the compiler in this case?
The text was updated successfully, but these errors were encountered: