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

MacOS CI builder uses C++03 by default. #2520

Closed
digit-google opened this issue Nov 4, 2024 · 0 comments
Closed

MacOS CI builder uses C++03 by default. #2520

digit-google opened this issue Nov 4, 2024 · 0 comments
Milestone

Comments

@digit-google
Copy link
Contributor

This was found by @sesse in PR #2519, the CMakeLists.txt only enforces C++11 for libninja. Anything else, i.e. the ninja binary and tests are compiled with the compiler's default setting.

It looks like this is still C++03 for the MacOS builder, resulting in surprising compilation failures.
The fix is to enforce C++11 as the minimum standard in the CMake configuration step of the corresponding github workflow file.

digit-google added a commit to digit-google/ninja that referenced this issue Nov 4, 2024
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
@jhasse jhasse closed this as completed in bc31ad0 Nov 7, 2024
@jhasse jhasse modified the milestones: 1.14.0, 1.13.0 Nov 7, 2024
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

No branches or pull requests

2 participants