summaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/configure.py b/configure.py
index bdf4613..981d401 100755
--- a/configure.py
+++ b/configure.py
@@ -45,6 +45,8 @@ parser.add_option('--with-gtest', metavar='PATH',
parser.add_option('--with-python', metavar='EXE',
help='use EXE as the Python interpreter',
default=os.path.basename(sys.executable))
+parser.add_option('--with-msvc-helper', metavar='NAME',
+ help="name for ninja-msvc-helper binary (MSVC only)")
(options, args) = parser.parse_args()
if args:
print 'ERROR: extra unparsed command-line arguments:', args
@@ -177,8 +179,11 @@ n.variable('ldflags', ' '.join(shell_escape(flag) for flag in ldflags))
n.newline()
if platform == 'windows':
+ compiler = '$cxx'
+ if options.with_msvc_helper:
+ compiler = '%s -o $out -- $cxx /showIncludes' % options.with_msvc_helper
n.rule('cxx',
- command='$cxx $cflags -c $in /Fo$out',
+ command='%s $cflags -c $in /Fo$out' % compiler,
depfile='$out.d',
description='CXX $out')
else:
@@ -282,6 +287,16 @@ ninja = n.build(binary('ninja'), 'link', objs, implicit=ninja_lib,
n.newline()
all_targets += ninja
+if platform == 'windows':
+ n.comment('Helper for working with MSVC.')
+ msvc_helper = n.build(binary('ninja-msvc-helper'), 'link',
+ cxx('msvc_helper_main-win32'),
+ implicit=ninja_lib,
+ variables=[('libs', libs)])
+ n.default(msvc_helper)
+ n.newline()
+ all_targets += msvc_helper
+
n.comment('Tests all build into ninja_test executable.')
variables = []
@@ -397,7 +412,6 @@ if host != 'mingw':
implicit=['configure.py', os.path.normpath('misc/ninja_syntax.py')])
n.newline()
-n.comment('Build only the main binary by default.')
n.default(ninja)
n.newline()