summaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-08-15 03:59:21 (GMT)
committerEvan Martin <martine@danga.com>2012-08-15 04:01:22 (GMT)
commitac04abe2f9c87afe4e4d43ac63e5af2dd10376fb (patch)
tree4c76804459e399ad3d61571920622a3e4250e48b /configure.py
parent59e0d69ec2775f1aa46d87ad7d14e6985e5187b6 (diff)
downloadNinja-ac04abe2f9c87afe4e4d43ac63e5af2dd10376fb.zip
Ninja-ac04abe2f9c87afe4e4d43ac63e5af2dd10376fb.tar.gz
Ninja-ac04abe2f9c87afe4e4d43ac63e5af2dd10376fb.tar.bz2
add a helper binary for wrapping cl.exe
Modify bootstrap etc. to make use of this binary.
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()