Skip to content

Commit

Permalink
don't attempt to build browse.* in bootstrap mode
Browse files Browse the repository at this point in the history
  • Loading branch information
evmar committed Jan 4, 2012
1 parent a0c058f commit d539655
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ def run(*args, **kwargs):
if e.errno != errno.EEXIST:
raise

with open('src/browse.py') as browse_py:
with open('build/browse_py.h', 'w') as browse_py_h:
hex_str = ''.join([hex(ord(c)) for c in browse_py.read()])
src = "const char %s[]=\"\n%s\n\";" % ('kBrowsePy', hex_str)
browse_py_h.write(src)

sources = []
for src in glob.glob('src/*.cc'):
if src.endswith('test.cc') or src.endswith('.in.cc'):
continue

filename = os.path.basename(src)
if filename == 'browse.cc': # Depends on generated header.
continue

if sys.platform.startswith('win32'):
if src.endswith('\\browse.cc') or src.endswith('\\subprocess.cc'):
if filename == 'subprocess.cc':
continue
else:
if src.endswith('-win32.cc'):
Expand All @@ -69,7 +67,8 @@ def run(*args, **kwargs):
args = [os.path.join(vcdir, 'bin', 'cl.exe'), '/nologo', '/EHsc', '/DWIN32']
else:
args = [os.environ.get('CXX', 'g++'), '-Wno-deprecated',
'-DNINJA_PYTHON="' + sys.executable + '"']
'-DNINJA_PYTHON="' + sys.executable + '"',
'-DNINJA_BOOTSTRAP']
args.extend(cflags)
args.extend(ldflags)
binary = 'ninja.bootstrap'
Expand Down
2 changes: 1 addition & 1 deletion src/ninja.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ int CmdQuery(State* state, int argc, char* argv[]) {

int CmdBrowse(State* state, const char* ninja_command,
int argc, char* argv[]) {
#ifndef WIN32
#if !defined(WIN32) && !defined(NINJA_BOOTSTRAP)
if (argc < 1) {
Error("expected a target to browse");
return 1;
Expand Down

0 comments on commit d539655

Please sign in to comment.