summaryrefslogtreecommitdiffstats
path: root/bootstrap.py
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2013-04-11 21:05:13 (GMT)
committerEvan Martin <martine@danga.com>2013-04-11 21:05:13 (GMT)
commit368f5bc64ddd2dcea2662d6c932157314be3e09b (patch)
tree148a6eb47ec2ff9b5a256e3b11882c804f94dfba /bootstrap.py
parent4497d0f247d1772c75949668d9c7351ae54565ce (diff)
downloadNinja-368f5bc64ddd2dcea2662d6c932157314be3e09b.zip
Ninja-368f5bc64ddd2dcea2662d6c932157314be3e09b.tar.gz
Ninja-368f5bc64ddd2dcea2662d6c932157314be3e09b.tar.bz2
bootstrap: make --windows usable for cl.exe-on-wine
Diffstat (limited to 'bootstrap.py')
-rwxr-xr-xbootstrap.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/bootstrap.py b/bootstrap.py
index f83b2d0..8feaf79 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -33,7 +33,7 @@ parser.add_option('--x64', action='store_true',
help='force 64-bit build (Windows)',)
# TODO: make this --platform to match configure.py.
parser.add_option('--windows', action='store_true',
- help='force native Windows build (when using Cygwin Python)',
+ help='force native Windows build',
default=sys.platform.startswith('win32'))
(options, conf_args) = parser.parse_args()
@@ -82,15 +82,17 @@ for src in glob.glob('src/*.cc'):
if options.windows:
sources.append('src/getopt.c')
-vcdir = os.environ.get('VCINSTALLDIR')
-if vcdir:
- if options.x64:
- cl = [os.path.join(vcdir, 'bin', 'x86_amd64', 'cl.exe')]
- if not os.path.exists(cl[0]):
- cl = [os.path.join(vcdir, 'bin', 'amd64', 'cl.exe')]
- else:
- cl = [os.path.join(vcdir, 'bin', 'cl.exe')]
- args = cl + ['/nologo', '/EHsc', '/DNOMINMAX']
+if options.windows:
+ cl = 'cl'
+ vcdir = os.environ.get('VCINSTALLDIR')
+ if vcdir:
+ if options.x64:
+ cl = os.path.join(vcdir, 'bin', 'x86_amd64', 'cl.exe')
+ if not os.path.exists(cl):
+ cl = os.path.join(vcdir, 'bin', 'amd64', 'cl.exe')
+ else:
+ cl = os.path.join(vcdir, 'bin', 'cl.exe')
+ args = [cl, '/nologo', '/EHsc', '/DNOMINMAX']
else:
args = shlex.split(os.environ.get('CXX', 'g++'))
cflags.extend(['-Wno-deprecated',
@@ -107,7 +109,7 @@ binary = 'ninja.bootstrap'
if options.windows:
binary = 'ninja.bootstrap.exe'
args.extend(sources)
-if vcdir:
+if options.windows:
args.extend(['/link', '/out:' + binary])
else:
args.extend(['-o', binary])