1 /*
  2     Ninja in one source file, similar to Lua's `one.c`.
  3 
  4     `browse.cc` is not included as that requires python, and it's an optional non-critical
  5     feature of relatively limited usefulness anyway.
  6 
  7     Apart from that tiny detail, everything else is included and should compile as expected on
  8     all tested platforms, namely: linux, macos (OSX), windows, freebsd and android (termux).
  9 
 10     Getting started
 11     ---------------
 12     *nix: c++ -O2 src/one.cc -o ninja
 13 
 14     osxcross: x86_64-apple-darwin19-c++ -O2 src/one.cc -o ninja
 15 
 16     mingw: x86_64-w64-mingw32-c++ -O2 src/one.cc -o ninja.exe
 17 
 18     msvc: cl.exe /nologo /Ox /GR- src\one.cc /out:ninja.exe
 19 
 20     You can define `NINJA_MAKE_LIB` if you want to build a static library instead of an executable.
 21 
 22     Changelog
 23     ---------
 24     2024-02-24 - Birth (Initial Release)
 25 */
 26 #if !defined(_DEBUG) && !defined(NDEBUG)
 27     #define NDEBUG
 28 #endif
 29 
 30 #ifdef _MSC_VER
 31     #ifndef NOMINMAX
 32         #define NOMINMAX
 33     #endif
 34 
 35     #ifndef _CRT_SECURE_NO_WARNINGS
 36         #define _CRT_SECURE_NO_WARNINGS
 37     #endif
 38 
 39     #ifndef _HAS_EXCEPTIONS
 40         #define _HAS_EXCEPTIONS 0
 41     #endif
 42 
 43     #pragma warning(disable : 4244)
 44 #endif
 45 
 46 #ifdef _WIN32
 47     #if defined(__GNUC__) && (defined(__MINGW32__) || defined(__MINGW64__))
 48         #ifndef _WIN32_WINNT
 49             #define _WIN32_WINNT 0x601
 50         #endif
 51 
 52         #ifndef __USE_MINGW_ANSI_STDIO
 53             #define __USE_MINGW_ANSI_STDIO 1
 54         #endif
 55     #endif
 56 
 57     #include "getopt.c"
 58 
 59     #define IsPathSeparator IsWin32PathSeparator
 60     #include "includes_normalize-win32.cc"
 61     #undef IsPathSeparator
 62 
 63     #include "minidump-win32.cc"
 64     #include "msvc_helper-win32.cc"
 65     #include "msvc_helper_main-win32.cc"
 66     #include "subprocess-win32.cc"
 67 #else
 68     #ifdef __GNUC__
 69         #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 70     #endif
 71     #include "subprocess-posix.cc"
 72 #endif
 73 
 74 #define kFileSignature kBuildLogFileSignature
 75 #define kCurrentVersion kBuildLogCurrentVersion
 76 
 77 #include "build_log.cc"
 78 
 79 #undef kFileSignature
 80 #undef kCurrentVersion
 81 
 82 #include "build.cc"
 83 #include "clean.cc"
 84 #include "clparser.cc"
 85 #include "debug_flags.cc"
 86 #include "depfile_parser.cc"
 87 #include "deps_log.cc"
 88 #include "disk_interface.cc"
 89 #include "dyndep.cc"
 90 #include "dyndep_parser.cc"
 91 #include "edit_distance.cc"
 92 #include "eval_env.cc"
 93 #include "graph.cc"
 94 #include "graphviz.cc"
 95 #include "json.cc"
 96 #include "lexer.cc"
 97 #include "line_printer.cc"
 98 #include "manifest_parser.cc"
 99 #include "metrics.cc"
100 #include "missing_deps.cc"
101 #include "parser.cc"
102 #include "state.cc"
103 #include "status.cc"
104 #include "string_piece_util.cc"
105 #include "util.cc"
106 #include "version.cc"
107 
108 #ifndef NINJA_MAKE_LIB
109     #include "ninja.cc"
110 #endif
111 
112 /* vim: set ts=4 sw=4 sts=4 noet: */