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

added missing include guards in order to support easy amalgamation #2385

Merged
merged 1 commit into from Feb 21, 2024

Conversation

icebreaker
Copy link
Contributor

@icebreaker icebreaker commented Feb 18, 2024

These changes make it easy to build an amalgamated ninja.cc that can be used to bootstrap ninja with just a working C++ compiler, without the need for any third-party tools like cmake or python.

*nix

c++ -O2 src/ninja_amalgamated.cc -o ninja

osx-cross

x86_64-apple-darwin19-c++ -O2 src/ninja_amalgamated.cc -o ninja

mingw

x86_64-w64-mingw32-c++ -O2 src/ninja_amalgamated.cc -o ninja.exe

msvc

cl.exe /nologo /Ox /GR- src\ninja_amalgamated.cc /out:ninja.exe

These changes make it easy to build an amalgamated `ninja.cc` that
can be used to bootstrap ninja with just a working C++ compiler, without
the need for any third-party tools like `cmake` or `python`.

*nix

c++ -O2 src/ninja_amalgamated.cc -o ninja

osx-cross

x86_64-apple-darwin19-c++ -O2 src/one.cc -o ninja

mingw

x86_64-w64-mingw32-c++ -O2 src/ninja_amalgamated.cc -o ninja.exe

msvc

cl.exe /nologo /Ox /GR- src\ninja_amalgamated.cc /out:ninja.exe
@digit-google
Copy link
Contributor

Thank you, this looks good to me. @jhasse what do you think?

@jhasse
Copy link
Collaborator

jhasse commented Feb 19, 2024

I would prefer #pragma once, otherwise LGTM.

@icebreaker
Copy link
Contributor Author

I initially wanted to go with #pragma once, but since all the other headers do it the old fashioned way, I decided to stay consistent.

@jhasse jhasse merged commit 5f93e5a into ninja-build:master Feb 21, 2024
10 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.

None yet

3 participants