Skip to content
Closed
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
build: configure formatting, add final message
This restores the pretty-printed options output for improved
readability and adds a final warning message to inform on possibly
scrolled-off warnings.
  • Loading branch information
silverwind committed Jan 28, 2015
commit 641f56fca4376a25d1a54d181a10bbfc43543fef
11 changes: 8 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import subprocess
import sys
import shutil
import string
import textwrap

CC = os.environ.get('CC', 'cc')
CXX = os.environ.get('CXX', 'c++')
Expand Down Expand Up @@ -297,9 +296,12 @@ auto_downloads = nodedownload.parse(options.download_list)


def warn(msg):
prefix = '\033[1m\033[91mWARNING\033[0m' if os.isatty(1) else 'WARNING'
warn.warned = True
prefix = '\033[1m\033[93mWARNING\033[0m' if os.isatty(1) else 'WARNING'
print('%s: %s' % (prefix, msg))

# track if warnings occured
warn.warned = False

def b(value):
"""Returns the string 'true' if value is truthy, 'false' otherwise."""
Expand Down Expand Up @@ -960,7 +962,7 @@ output = {
'variables': variables,
'target_defaults': output
}
print textwrap.fill(str(output), 78)
pprint.pprint(output, indent=2)

write('config.gypi', do_not_edit +
pprint.pformat(output, indent=2) + '\n')
Expand Down Expand Up @@ -990,4 +992,7 @@ else:

gyp_args += args

if warn.warned:
warn('warnings were emitted in the configure phase')

sys.exit(subprocess.call(gyp_args))