summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.py11
-rw-r--r--src/msvc_helper-win32.cc4
-rw-r--r--src/msvc_helper_main-win32.cc4
-rw-r--r--src/ninja.cc4
4 files changed, 16 insertions, 7 deletions
diff --git a/configure.py b/configure.py
index 98274e6..e458605 100755
--- a/configure.py
+++ b/configure.py
@@ -277,11 +277,12 @@ for name in ['build',
'util']:
objs += cxx(name)
if platform in ('mingw', 'windows'):
- objs += cxx('subprocess-win32')
+ for name in ['subprocess-win32',
+ 'includes_normalize-win32',
+ 'msvc_helper-win32',
+ 'msvc_helper_main-win32']:
+ objs += cxx(name)
if platform == 'windows':
- objs += cxx('includes_normalize-win32')
- objs += cxx('msvc_helper-win32')
- objs += cxx('msvc_helper_main-win32')
objs += cxx('minidump-win32')
objs += cc('getopt')
else:
@@ -349,7 +350,7 @@ for name in ['build_log_test',
'test',
'util_test']:
objs += cxx(name, variables=[('cflags', test_cflags)])
-if platform == 'windows':
+if platform in ('windows', 'mingw'):
for name in ['includes_normalize_test', 'msvc_helper_test']:
objs += cxx(name, variables=[('cflags', test_cflags)])
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