Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cleanup: support CMake >= 3.10 #1544

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

Merged
merged 3 commits into from
Feb 17, 2023
Merged

cleanup: support CMake >= 3.10 #1544

merged 3 commits into from
Feb 17, 2023

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Feb 16, 2023

This aligns the project with the CMake support policies in:

https://opensource.google/documentation/policies/cplusplus-support

I also simplied the management of CMake policies. Most of the overriden policies (anything <= CMP0067) are enabled by default when you require CMake >= 3.10. But it is easier to just declare that you will accept newer policies when they are available using the ...3.22 notation.

Part of the work for #1509

@coryan coryan marked this pull request as ready for review February 16, 2023 15:28
endif()
endforeach()
# Require CMake 3.10. If available, use the policies up to CMake 3.22.
cmake_minimum_required (VERSION 3.10...3.22)
Copy link
Member

Choose a reason for hiding this comment

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

https://google.github.io/benchmark/dependencies.html is pretty clear about why we support 3.16.3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I am asking you to reconsider. A number of other Google projects are perfectly capable of making forward progress (AFAICT that is the why in that document) while supporting CMake >= 3.10. And it is not like this project was using any CMake > 3.16 features. In fact, it seems this project uses more CMake < 3.0 idioms than CMake >= 3 idioms.

In any case, this is your project. If you cannot support CMake 3.10, we will just have to keep using the older versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dmah42 I also think this policy may be worth reconsidering. Abseil, Protobuf, and gRPC (among others) have published a C++ support policy that allows us to move forward while also allowing each project to remain compatible with eachother. More and more Google projects are adopting these policies. I think it would be good if Google benchmark considering following suite.

Copy link
Member

Choose a reason for hiding this comment

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

i didn't intend this to be the end of the conversation. it was a little brusque (sorry) but my intent was to ensure that we understand the implications of opening up to older cmake versions.

i remember we had to go past 3.7 to support some features at some point, but we may have just skipped right over 3.10.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @dmah42 ! I'll let @coryan follow up w/ the PR, but I wanted to also point out that at the top of https://opensource.google/documentation/policies/cplusplus-support there's a link to this table, which lists the specific versions of things that we support. It makes it a bit easier to see which versions the policies implies. In this case, we can see that the table is showing CMake >= 3.10, which is where Carlos was getting these versions.

Copy link
Member

Choose a reason for hiding this comment

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

yep, i saw. i think we might want to just point at this rather than track our own dependencies, as long as we're true to it (as in my other comment).

@coryan
Copy link
Contributor Author

coryan commented Feb 16, 2023

Closing for now. If you change your mind let me know and I will gladly send the PR again.

@coryan coryan closed this Feb 16, 2023
@coryan coryan deleted the cleanup-support-CMake-3-10 branch February 16, 2023 15:55
@coryan coryan restored the cleanup-support-CMake-3-10 branch February 16, 2023 18:26
@dmah42 dmah42 reopened this Feb 16, 2023
@dmah42
Copy link
Member

dmah42 commented Feb 16, 2023

seems like it works so sure.. can we update the dependencies.md doc to point to the C++ support policy (or the README to point to it instead of the dependencies doc, if it's completely subsumed)?

@coryan
Copy link
Contributor Author

coryan commented Feb 16, 2023

I looked into the CI failure, and I am not sure how it could be related to this change. But do let me know if I should look further or you have suggestions for fixes.

@coryan
Copy link
Contributor Author

coryan commented Feb 16, 2023

Also, if you want any other changes in the PR do let me know too.

@EricWF
Copy link
Contributor

EricWF commented Feb 16, 2023

I think this change makes sense, and I'm OK going appropriately backwards in our support here because the support policy of these other projects should be our support policy as well.

Could this PR add a pointer to the support policy of the other projects mentioned in the discussion, preferably Googletests', as well as a statement affirming that we plan to follow said policy as well.

@coryan
Copy link
Contributor Author

coryan commented Feb 16, 2023

@EricWF I do not believe googletest has changed their README file to state what is their support policy (whether that means they have not adopted the OSS Foundations policy or not, I could not say). I think Abseil has, and we both know those teams are closely related. Is that enough?

If so, I am happy to edit /docs/dependencies.md, or any other .md file here that you think is appropriate.

@dmah42
Copy link
Member

dmah42 commented Feb 17, 2023

@EricWF I do not believe googletest has changed their README file to state what is their support policy (whether that means they have not adopted the OSS Foundations policy or not, I could not say). I think Abseil has, and we both know those teams are closely related. Is that enough?

If so, I am happy to edit /docs/dependencies.md, or any other .md file here that you think is appropriate.

yes please update docs/dependencies.md to point to the policy for CMake. thanks.

the CI failure is not you.

This aligns the project with the CMake support policies in:

https://opensource.google/documentation/policies/cplusplus-support

I also simplied the management of CMake policies. Most of the overriden
policies (anything <= CMP0067) are enabled by default when you require
CMake >= 3.10.  But it is easier to just declare that you will accept
newer policies when they are available using the `...3.22` notation.
@coryan
Copy link
Contributor Author

coryan commented Feb 17, 2023

yes please update docs/dependencies.md to point to the policy for CMake. thanks.

Done. And rebased.

@dmah42 dmah42 merged commit b111d01 into google:main Feb 17, 2023
@dmah42
Copy link
Member

dmah42 commented Feb 17, 2023

thanks!

@coryan coryan deleted the cleanup-support-CMake-3-10 branch February 17, 2023 13:39
@LebedevRI
Copy link
Collaborator

Is there a CI entry to ensure that cmake-3.10 actually works for us?

devjgm added a commit to devjgm/benchmark that referenced this pull request Feb 17, 2023
devjgm added a commit to devjgm/benchmark that referenced this pull request Feb 21, 2023
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.

5 participants