Added -N/--ninja option to acprep

This commit is contained in:
John Wiegley 2012-09-27 17:42:43 -05:00
parent a9bd40a1e3
commit dcd64a6782
2 changed files with 9 additions and 3 deletions

10
acprep
View file

@ -300,6 +300,9 @@ class PrepareBuild(CommandLineApp):
action="store", dest="compiler",
help='Use the Clang C++ compiler')
op.add_option('-N', '--ninja', action='store_true', dest='use_ninja',
default=False,
help='Use ninja to build, rather than make')
op.add_option('', '--no-git', action='store_true', dest='no_git',
default=False,
help='Do not call out to Git; useful for offline builds')
@ -657,7 +660,6 @@ class PrepareBuild(CommandLineApp):
#########################################################################
def setup_for_johnw(self):
self.configure_args.append('-GNinja')
self.configure_args.append('-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON')
if not self.options.compiler:
@ -690,6 +692,9 @@ class PrepareBuild(CommandLineApp):
if self.options.no_python:
self.configure_args.remove('-DUSE_PYTHON=1')
if self.options.use_ninja:
self.configure_args.append('-GNinja')
if exists('/Users/johnw/Projects/ledger/plan/TODO'):
self.setup_for_johnw()
@ -897,7 +902,8 @@ class PrepareBuild(CommandLineApp):
self.log.debug('Changing directory to ' + build_dir)
os.chdir(build_dir)
self.execute(*(['make'] + make_args))
self.execute(*(['ninja' if self.options.use_ninja else 'make'] +
make_args))
finally:
os.chdir(self.source_dir)

View file

@ -4,7 +4,7 @@ flavor=$1
shift 1
JOBS=-j$(sysctl -n hw.activecpu)
OPTIONS="$flavor --debug --python --doxygen $JOBS"
OPTIONS="$flavor --debug --python --ninja --doxygen $JOBS"
time ( \
cd ~/src/ledger ; \