-
Notifications
You must be signed in to change notification settings - Fork 284
/
Copy pathbuild.py
executable file
·48 lines (38 loc) · 986 Bytes
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
"""A convenience script to build all pytype targets.
Usage:
$> build.py [-c]
Specifying the -c option forces a clobber before building.
"""
import argparse
import sys
import build_utils
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--clobber",
"-c",
action="store_true",
default=False,
help="Force clobber before building.",
)
parser.add_argument(
"--debug",
"-d",
action="store_true",
default=False,
help="Build targets in the debug mode.",
)
return parser.parse_args()
def main():
options = parse_args()
if not build_utils.run_cmake(
force_clean=options.clobber, log_output=True, debug_build=options.debug
):
sys.exit(1)
print("Building all targets with Ninja ...\n")
if not build_utils.run_ninja(["all"], fail_fast=True, verbose=True):
sys.exit(1)
print("Pytype built successfully!\n")
if __name__ == "__main__":
main()