Skip to content

Commit 0c46580

Browse files
committed
build-script: Emit warning for --xcode invocations that links out to integration with Ninja tutorial
1 parent f00cffe commit 0c46580

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

utils/build-script

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ def print_note(message, stream=sys.stdout):
5757
stream.flush()
5858

5959

60+
def print_warning(message, stream=sys.stdout):
61+
"""Writes a warning to the given stream. By default this function outputs
62+
to stdout.
63+
"""
64+
65+
warning = "[{}] WARNING: {}\n".format(sys.argv[0], message)
66+
magenta_warning = "\033[35m" + warning + "\033[0m"
67+
68+
stream.write(magenta_warning)
69+
stream.flush()
70+
71+
6072
def clean_delay():
6173
"""Provide a short delay so accidentally invoked clean builds can be
6274
canceled.
@@ -746,6 +758,17 @@ def main_normal():
746758
tar(source=prefix.lstrip('/'),
747759
destination=args.symbols_package)
748760

761+
if args.cmake_generator == "Xcode":
762+
print_warning(
763+
"The Xcode projects generated with '--xcode' can be used for "
764+
"navigation or editing purposes, but are not a recommended means "
765+
"to building, running or debugging. For a full-fledged Xcode "
766+
"workflow using these generated projects, see "
767+
"https://github.com/apple/swift/blob/main/docs/HowToGuides/"
768+
"GettingStarted.md#using-ninja-with-xcode"
769+
)
770+
print()
771+
749772
return 0
750773

751774

0 commit comments

Comments
 (0)