summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xacprep10
-rwxr-xr-xtools/build.sh2
2 files changed, 9 insertions, 3 deletions
diff --git a/acprep b/acprep
index ebf776db..26f8d8b2 100755
--- a/acprep
+++ b/acprep
@@ -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)
diff --git a/tools/build.sh b/tools/build.sh
index 2abf70b8..e79689e3 100755
--- a/tools/build.sh
+++ b/tools/build.sh
@@ -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 ; \