Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the bootstrap to be verbose #265

Merged
merged 1 commit into from
Apr 10, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from optparse import OptionParser
import sys
import os
import glob
import errno
import shlex
import subprocess

parser = OptionParser()
parser.add_option('--verbose', action='store_true',
help='enable verbose build',)
(options, conf_args) = parser.parse_args()

def run(*args, **kwargs):
try:
subprocess.check_call(*args, **kwargs)
Expand Down Expand Up @@ -81,11 +87,19 @@ def run(*args, **kwargs):
args.extend(['/link', '/out:' + binary])
else:
args.extend(['-o', binary])

if options.verbose:
print ' '.join(args)

run(args)

verbose = []
if options.verbose:
verbose = ['-v']

print 'Building ninja using itself...'
run([sys.executable, 'configure.py'] + sys.argv[1:])
run(['./' + binary])
run([sys.executable, 'configure.py'] + conf_args)
run(['./' + binary] + verbose)
os.unlink(binary)

print 'Done!'