From 453ff1262f4b9a514ec9ad333037fabed75ed10b Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Fri, 20 Jun 2014 01:01:52 +0400 Subject: [PATCH] build.py: support visual studio for open option --- bin/build.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/bin/build.py b/bin/build.py index 56582718..7216602e 100755 --- a/bin/build.py +++ b/bin/build.py @@ -48,9 +48,10 @@ args = parser.parse_args() -for x in args.fwd: - if not x.startswith('D'): - sys.exit("Expected that forward argument starts with `D`: {}".format(x)) +if args.fwd != None: + for x in args.fwd: + if not x.startswith('D'): + sys.exit("Expected that forward argument starts with `D`: {}".format(x)) toolchain = '' generator = '' @@ -152,8 +153,9 @@ def call(call_args): if args.install: generate_command.append(install_dir_option) -for x in args.fwd: - generate_command.append("-{}".format(x)) +if args.fwd != None: + for x in args.fwd: + generate_command.append("-{}".format(x)) call(generate_command) @@ -174,10 +176,15 @@ def call(call_args): if not args.nobuild: call(build_command) -if (toolchain == 'xcode') and args.open: - for file in os.listdir(build_dir): - if file.endswith(".xcodeproj"): - call(['open', os.path.join(build_dir, file)]) +if args.open: + if (args.toolchain == 'xcode'): + for file in os.listdir(build_dir): + if file.endswith(".xcodeproj"): + call(['open', os.path.join(build_dir, file)]) + if (args.toolchain == 'vs2013x64') or (args.toolchain == 'vs2013'): + for file in os.listdir(build_dir): + if file.endswith(".sln"): + os.startfile(os.path.join(build_dir, file)) if args.test: os.chdir(build_dir)