Skip to content

Commit

Permalink
added missing include guards
Browse files Browse the repository at this point in the history
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
  • Loading branch information
icebreaker committed Feb 18, 2024
1 parent a1ad0fb commit 9a4f715
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/includes_normalize.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef INCLUDES_NORMALIZE_H_
#define INCLUDES_NORMALIZE_H_

#include <string>
#include <vector>

Expand All @@ -38,3 +41,5 @@ struct IncludesNormalize {
std::string relative_to_;
std::vector<StringPiece> split_relative_to_;
};

#endif // INCLUDES_NORMALIZE_H_
5 changes: 5 additions & 0 deletions src/msvc_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MSVC_HELPER_H_
#define MSVC_HELPER_H_

#include <string>

std::string EscapeForDepfile(const std::string& path);
Expand All @@ -30,3 +33,5 @@ struct CLWrapper {

void* env_block_;
};

#endif // MSVC_HELPER_H_

0 comments on commit 9a4f715

Please sign in to comment.