diff --git a/bootstrap.py b/bootstrap.py index a5df22a0b1..e2aa8668a3 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -26,6 +26,8 @@ parser = OptionParser() parser.add_option('--verbose', action='store_true', help='enable verbose build',) +parser.add_option('--x64', action='store_true', + help='force 64-bit build (Windows)',) (options, conf_args) = parser.parse_args() def run(*args, **kwargs): @@ -74,8 +76,12 @@ def run(*args, **kwargs): vcdir = os.environ.get('VCINSTALLDIR') if vcdir: - args = [os.path.join(vcdir, 'bin', 'cl.exe'), - '/nologo', '/EHsc', '/DNOMINMAX'] + if options.x64: + args = [os.path.join(vcdir, 'bin', 'amd64', 'cl.exe'), + '/nologo', '/EHsc', '/DNOMINMAX'] + else: + args = [os.path.join(vcdir, 'bin', 'cl.exe'), + '/nologo', '/EHsc', '/DNOMINMAX'] else: args = shlex.split(os.environ.get('CXX', 'g++')) cflags.extend(['-Wno-deprecated', @@ -83,6 +89,8 @@ def run(*args, **kwargs): '-DNINJA_BOOTSTRAP']) if sys.platform.startswith('win32'): cflags.append('-D_WIN32_WINNT=0x0501') + if options.x64: + cflags.append('-m64') args.extend(cflags) args.extend(ldflags) binary = 'ninja.bootstrap'