aboutsummaryrefslogtreecommitdiff
path: root/bootstrap.py
diff options
context:
space:
mode:
authorHannu Koivisto <azure@iki.fi>2012-10-10 14:17:42 +0300
committerHannu Koivisto <azure@iki.fi>2012-11-09 12:06:18 +0200
commit489cc06d0fa49e55137109d1b94f7b116fa59f38 (patch)
tree58b3974330e74bb01154f4054497756c93fceb7b /bootstrap.py
parent93e509469953a90f31afc838536b82568da397b2 (diff)
downloadninja-489cc06d0fa49e55137109d1b94f7b116fa59f38.tar.gz
Add --windows option to bootstrap.py
Makes it possible to make a native Windows build when using Cygwin Python.
Diffstat (limited to 'bootstrap.py')
-rwxr-xr-xbootstrap.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/bootstrap.py b/bootstrap.py
index 12848ac..7463d34 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -31,6 +31,9 @@ parser.add_option('--verbose', action='store_true',
help='enable verbose build',)
parser.add_option('--x64', action='store_true',
help='force 64-bit build (Windows)',)
+parser.add_option('--windows', action='store_true',
+ help='force native Windows build (when using Cygwin Python)',
+ default=sys.platform.startswith('win32'))
(options, conf_args) = parser.parse_args()
def run(*args, **kwargs):
@@ -66,7 +69,7 @@ for src in glob.glob('src/*.cc'):
if filename == 'browse.cc': # Depends on generated header.
continue
- if sys.platform.startswith('win32'):
+ if options.windows:
if src.endswith('-posix.cc'):
continue
else:
@@ -75,7 +78,7 @@ for src in glob.glob('src/*.cc'):
sources.append(src)
-if sys.platform.startswith('win32'):
+if options.windows:
sources.append('src/getopt.c')
vcdir = os.environ.get('VCINSTALLDIR')
@@ -90,14 +93,14 @@ else:
cflags.extend(['-Wno-deprecated',
'-DNINJA_PYTHON="' + sys.executable + '"',
'-DNINJA_BOOTSTRAP'])
- if sys.platform.startswith('win32'):
+ if options.windows:
cflags.append('-D_WIN32_WINNT=0x0501')
if options.x64:
cflags.append('-m64')
args.extend(cflags)
args.extend(ldflags)
binary = 'ninja.bootstrap'
-if sys.platform.startswith('win32'):
+if options.windows:
binary = 'ninja.bootstrap.exe'
args.extend(sources)
if vcdir:
@@ -118,7 +121,7 @@ verbose = []
if options.verbose:
verbose = ['-v']
-if sys.platform.startswith('win32'):
+if options.windows:
print('Building ninja using itself...')
run([sys.executable, 'configure.py', '--with-ninja=%s' % binary] +
conf_args)