Skip to content

Commit fcb9fe2

Browse files
committed
Merge pull request #231 from mxcl/bootstrap-release
Add --release flag for bootstrap script
2 parents ca9b5fc + 3e3460d commit fcb9fe2

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Utilities/bootstrap

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ def main():
534534
help="Path to Foundation build directory")
535535
parser.add_argument("--xctest", dest="xctest_path",
536536
help="Path to XCTest build directory")
537+
parser.add_argument("--release", action="store_true",
538+
help="Build stage 2 for release")
537539
args = parser.parse_args()
538540

539541
if not args.swiftc_path:
@@ -638,6 +640,9 @@ def main():
638640
cmd.extend(["-Xswiftc", "-I{}".format(args.foundation_path)])
639641
cmd.extend(["-Xswiftc", "-I{}".format(core_foundation_path)])
640642

643+
if args.release:
644+
cmd.extend(["--configuration", "release"])
645+
641646
cmd = env_cmd + cmd
642647

643648
note("building self-hosted 'swift-build': %s" % (
@@ -646,16 +651,20 @@ def main():
646651
if result != 0:
647652
error("build failed with exit status %d" % (result,))
648653

649-
swift_build_path = os.path.join(build_path, "debug", "swift-build")
650-
swift_test_path = os.path.join(build_path, "debug", "swift-test")
651-
note("built: %s" % (swift_build_path,))
654+
if args.release:
655+
conf = "release"
656+
else:
657+
conf = "debug"
658+
659+
swift_build_path = os.path.join(build_path, conf, "swift-build")
660+
swift_test_path = os.path.join(build_path, conf, "swift-test")
652661

653662
# If testing, run each of the test bundles.
654663
if "test" in build_actions:
655664
# Construct the test environment.
656665
env_cmd = ["env", "SWIFT_EXEC=" + os.path.join(bindir, "swiftc"),
657666
"SWIFT_BUILD_PATH=" + build_path]
658-
cmd = env_cmd + [os.path.join(build_path, "debug", "swift-test")]
667+
cmd = env_cmd + [swift_test_path]
659668
result = subprocess.call(cmd, cwd=g_project_root)
660669
if result != 0:
661670
error("tests failed with exit status %d" % (result,))

0 commit comments

Comments
 (0)