diff options
author | Jon <jon.forums@gmail.com> | 2012-09-20 14:05:11 (GMT) |
---|---|---|
committer | Jon <jon.forums@gmail.com> | 2012-09-20 14:05:11 (GMT) |
commit | 3b3e1c831cc49d8c02928aaad7683c820cce9400 (patch) | |
tree | 993c5b27b81e96c041bb9d0ef7a40d84110e0cc9 /src | |
parent | e6c8bd91c22b64374aa7a1c84ae0a462f4fe2896 (diff) | |
download | Ninja-3b3e1c831cc49d8c02928aaad7683c820cce9400.zip Ninja-3b3e1c831cc49d8c02928aaad7683c820cce9400.tar.gz Ninja-3b3e1c831cc49d8c02928aaad7683c820cce9400.tar.bz2 |
Give MinGW builds MSVC build helper superpowers
Note: _WIN32 is used instead of WIN32 to enable builds with MSVC
IDE, Windows SDK non-IDE command line tools, and mingw/mingw-w64
based toolchains
Diffstat (limited to 'src')
-rw-r--r-- | src/msvc_helper-win32.cc | 4 | ||||
-rw-r--r-- | src/msvc_helper_main-win32.cc | 4 | ||||
-rw-r--r-- | src/ninja.cc | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/msvc_helper-win32.cc b/src/msvc_helper-win32.cc index a9f34aa..cb2010f 100644 --- a/src/msvc_helper-win32.cc +++ b/src/msvc_helper-win32.cc @@ -17,6 +17,10 @@ #include <string.h> #include <windows.h> +#ifdef __MINGW32__ +#include <stdio.h> +#endif + #include "includes_normalize.h" #include "util.h" diff --git a/src/msvc_helper_main-win32.cc b/src/msvc_helper_main-win32.cc index ed7674c..4ff14a0 100644 --- a/src/msvc_helper_main-win32.cc +++ b/src/msvc_helper_main-win32.cc @@ -16,6 +16,10 @@ #include <windows.h> +#ifdef __MINGW32__ +#include <stdio.h> +#endif + #include "util.h" #include "getopt.h" diff --git a/src/ninja.cc b/src/ninja.cc index c9196f8..6046d72 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -292,7 +292,7 @@ int ToolBrowse(Globals* globals, int argc, char* argv[]) { } #endif // _WIN32 -#if defined(WIN32) +#if defined(_WIN32) int ToolMSVC(Globals* globals, int argc, char* argv[]) { // Reset getopt: push one argument onto the front of argv, reset optind. argc++; @@ -537,7 +537,7 @@ int ChooseTool(const string& tool_name, const Tool** tool_out) { { "browse", "browse dependency graph in a web browser", Tool::RUN_AFTER_LOAD, ToolBrowse }, #endif -#if defined(WIN32) +#if defined(_WIN32) { "msvc", "build helper for MSVC cl.exe (EXPERIMENTAL)", Tool::RUN_AFTER_FLAGS, ToolMSVC }, #endif |