add bootstrap option to force 64-bit
authorMatthew Woehlke <matthew.woehlke@kitware.com>
Fri, 3 Aug 2012 22:42:44 +0000 (18:42 -0400)
committerEvan Martin <martine@danga.com>
Fri, 10 Aug 2012 19:42:34 +0000 (12:42 -0700)
bootstrap.py

index a5df22a..e2aa866 100755 (executable)
@@ -26,6 +26,8 @@ os.chdir(os.path.dirname(os.path.abspath(__file__)))
 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 @@ if sys.platform.startswith('win32'):
 
 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 @@ else:
                    '-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'