summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-09-21 22:36:52 (GMT)
committerEvan Martin <martine@danga.com>2012-09-21 22:36:52 (GMT)
commite4eef72db86cc321a73da03bd7b7a9b2df83b1af (patch)
treead27dbb81846fdcbcdc530c4835f988a09015792
parentd0ac9ded9d577c9a9e6fffd3921c6100c8a20b6b (diff)
parent39b2d7fc6c9bb2a06b60a65b546b4c7c89c02e46 (diff)
downloadNinja-e4eef72db86cc321a73da03bd7b7a9b2df83b1af.zip
Ninja-e4eef72db86cc321a73da03bd7b7a9b2df83b1af.tar.gz
Ninja-e4eef72db86cc321a73da03bd7b7a9b2df83b1af.tar.bz2
Merge pull request #427 from jonforums/jf/mingw-n-msvc
fix mingw build fail - redux
-rwxr-xr-xconfigure.py12
-rw-r--r--src/msvc_helper-win32.cc1
-rw-r--r--src/msvc_helper_main-win32.cc1
-rw-r--r--src/ninja.cc4
4 files changed, 11 insertions, 7 deletions
diff --git a/configure.py b/configure.py
index 98274e6..8d9f31e 100755
--- a/configure.py
+++ b/configure.py
@@ -140,6 +140,7 @@ else:
'-fno-rtti',
'-fno-exceptions',
'-fvisibility=hidden', '-pipe',
+ '-Wno-missing-field-initializers',
'-DNINJA_PYTHON="%s"' % options.with_python]
if options.debug:
cflags += ['-D_GLIBCXX_DEBUG', '-D_GLIBCXX_DEBUG_PEDANTIC']
@@ -277,11 +278,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 +351,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 ee260ab..fd9b671 100644
--- a/src/msvc_helper-win32.cc
+++ b/src/msvc_helper-win32.cc
@@ -14,6 +14,7 @@
#include "msvc_helper.h"
+#include <stdio.h>
#include <string.h>
#include <windows.h>
diff --git a/src/msvc_helper_main-win32.cc b/src/msvc_helper_main-win32.cc
index 5e28e6d..4a4b3c4 100644
--- a/src/msvc_helper_main-win32.cc
+++ b/src/msvc_helper_main-win32.cc
@@ -14,6 +14,7 @@
#include "msvc_helper.h"
+#include <stdio.h>
#include <windows.h>
#include "util.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