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

Fix for #2520: Force C++11 for MacOS CI builder. #2521

Conversation

digit-google
Copy link
Contributor

MacOS CI builders use a compiler which defaults to C++03. Unfortunately, CMakeLists.txt only forces C++11 for libninja, try to force it through CMAKE_CXX_STANDARD.

Note a few interesting points:

  • Tests use GoogleTest which officially requires C++14. However, it seems that compiling them with C++03 or C++11 doesn´t seem to be an issue on this platform for now.

  • To avoid future problems, it might be useful to enforce a separate default of C++14 for test programs.

  • GoogleTest plans to switch to C++17 in December 2024 [1],

[1] https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md

MacOS CI builders use a compiler which defaults to C++03.
Unfortunately, CMakeLists.txt only forces C++11 for libninja,
try to force it through CMAKE_CXX_STANDARD.

Note a few interesting points:

- Tests use GoogleTest which officially *requires* C++14.
  However, it seems that compiling them with C++03 or C++11
  doesn´t seem to be an issue on this platform for now.

- To avoid future problems, it might be useful to enforce
  a separate default of C++14 for test programs.

- GoogleTest plans to switch to C++17 in December 2024 [1],

[1] https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md
@digit-google digit-google mentioned this pull request Nov 4, 2024
@jhasse
Copy link
Collaborator

jhasse commented Nov 5, 2024

Enabling C++11 should be done in the CMakeLists.txt instead, so users don't have to pass -DCMAKE_CXX_STANDARD=11 themselves.

btw: We are using the last GoogleTest that supports C++11, so no need for bumping further.

@jhasse jhasse closed this Nov 5, 2024
@digit-google
Copy link
Contributor Author

Oh I see, I'll upload a different PR then, thanks.

@digit-google digit-google deleted the fix-2520-macos-force-c++11 branch November 5, 2024 09:21
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