mirror of
https://github.com/reactos/ninja.git
synced 2024-12-13 14:25:53 +00:00
windows: more build fixes
This commit is contained in:
parent
4a09acf125
commit
f4df3f731a
23
bootstrap.py
23
bootstrap.py
@ -43,8 +43,9 @@ except OSError, e:
|
||||
|
||||
with open('src/browse.py') as browse_py:
|
||||
with open('build/browse_py.h', 'w') as browse_py_h:
|
||||
run(['./src/inline.sh', 'kBrowsePy'],
|
||||
stdin=browse_py, stdout=browse_py_h)
|
||||
hex_str = ''.join([hex(ord(c)) for c in browse_py.read()])
|
||||
src = "const char %s[]=\"\n%s\n\";" % ('kBrowsePy', hex_str)
|
||||
browse_py_h.write(src)
|
||||
|
||||
sources = []
|
||||
for src in glob.glob('src/*.cc'):
|
||||
@ -52,7 +53,7 @@ for src in glob.glob('src/*.cc'):
|
||||
continue
|
||||
|
||||
if sys.platform.startswith('win32'):
|
||||
if src.endswith('/browse.cc') or src.endswith('/subprocess.cc'):
|
||||
if src.endswith('\\browse.cc') or src.endswith('\\subprocess.cc'):
|
||||
continue
|
||||
else:
|
||||
if src.endswith('-win32.cc'):
|
||||
@ -60,15 +61,25 @@ for src in glob.glob('src/*.cc'):
|
||||
|
||||
sources.append(src)
|
||||
|
||||
args = [os.environ.get('CXX', 'g++'), '-Wno-deprecated',
|
||||
'-DNINJA_PYTHON="' + sys.executable + '"']
|
||||
if sys.platform.startswith('win32'):
|
||||
sources.append('src/getopt.c')
|
||||
|
||||
vcdir = os.environ.get('VCINSTALLDIR')
|
||||
if vcdir:
|
||||
args = [os.path.join(vcdir, 'bin', 'cl.exe'), '/nologo', '/EHsc', '/DWIN32']
|
||||
else:
|
||||
args = [os.environ.get('CXX', 'g++'), '-Wno-deprecated',
|
||||
'-DNINJA_PYTHON="' + sys.executable + '"']
|
||||
args.extend(cflags)
|
||||
args.extend(ldflags)
|
||||
binary = 'ninja.bootstrap'
|
||||
if sys.platform.startswith('win32'):
|
||||
binary = 'ninja.bootstrap.exe'
|
||||
args.extend(['-o', binary])
|
||||
args.extend(sources)
|
||||
if vcdir:
|
||||
args.extend(['/link', '/out:' + binary])
|
||||
else:
|
||||
args.extend(['-o', binary])
|
||||
run(args)
|
||||
|
||||
print 'Building ninja using itself...'
|
||||
|
@ -140,7 +140,7 @@ n.newline()
|
||||
|
||||
if platform == 'windows':
|
||||
n.rule('cxx',
|
||||
command='$cxx $cflags -c $in /Fo $out',
|
||||
command='$cxx $cflags -c $in /Fo$out',
|
||||
depfile='$out.d',
|
||||
description='CXX $out')
|
||||
else:
|
||||
|
12
src/getopt.c
12
src/getopt.c
@ -396,17 +396,17 @@ getopt (int argc, char **argv, char *optstring)
|
||||
}
|
||||
|
||||
int
|
||||
getopt_long (int argc, char **argv, char *shortopts,
|
||||
GETOPT_LONG_OPTION_T * longopts, int *longind)
|
||||
getopt_long (int argc, char **argv, const char *shortopts,
|
||||
const GETOPT_LONG_OPTION_T * longopts, int *longind)
|
||||
{
|
||||
return getopt_internal (argc, argv, shortopts, longopts, longind, 0);
|
||||
return getopt_internal (argc, argv, (char*)shortopts, (GETOPT_LONG_OPTION_T*)longopts, longind, 0);
|
||||
}
|
||||
|
||||
int
|
||||
getopt_long_only (int argc, char **argv, char *shortopts,
|
||||
GETOPT_LONG_OPTION_T * longopts, int *longind)
|
||||
getopt_long_only (int argc, char **argv, const char *shortopts,
|
||||
const GETOPT_LONG_OPTION_T * longopts, int *longind)
|
||||
{
|
||||
return getopt_internal (argc, argv, shortopts, longopts, longind, 1);
|
||||
return getopt_internal (argc, argv, (char*)shortopts, (GETOPT_LONG_OPTION_T*)longopts, longind, 1);
|
||||
}
|
||||
|
||||
/* end of file GETOPT.C */
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "eval_env.h"
|
||||
#include "util.h"
|
||||
|
||||
bool Lexer::Error(const string& message, string* err) {
|
||||
// Compute line/column.
|
||||
|
@ -14,6 +14,11 @@
|
||||
|
||||
#include "string_piece.h"
|
||||
|
||||
// Windows may #define ERROR.
|
||||
#ifdef ERROR
|
||||
#undef ERROR
|
||||
#endif
|
||||
|
||||
struct EvalString;
|
||||
|
||||
struct Lexer {
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "eval_env.h"
|
||||
#include "util.h"
|
||||
|
||||
bool Lexer::Error(const string& message, string* err) {
|
||||
// Compute line/column.
|
||||
|
Loading…
Reference in New Issue
Block a user