Skip to content

Commit

Permalink
Add warning for ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
NickGerleman committed Oct 31, 2023
1 parent ebc5d37 commit a347ff6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions javascript/just.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function runBenchTask() {
}

function findExecutable(name, failureMessage) {
const exec = tryFindExecutable(name);
const exec = which.sync(name, {nothrow: true});
if (exec) {
return exec;
}
Expand All @@ -143,14 +143,21 @@ function findExecutable(name, failureMessage) {
process.exit(1);
}

function tryFindExecutable(name) {
return which.sync(name, {nothrow: true});
function tryFindExecutable(name, failureMessage) {
const exec = which.sync(name, {nothrow: true});
if (exec) {
return exec;
}

logger.warn(chalk.bold.yellow(failureMessage));
return exec;
}

function emcmakeGenerateTask() {
return () => {
const emcmake = findExecutable('emcmake', 'Please install the emscripten SDK: https://emscripten.org/docs/getting_started/');
const ninja = tryFindExecutable('ninja');
const ninja = tryFindExecutable('ninja', 'Warning: Install Ninja (e.g. "brew install ninja") for faster builds');
const emcmake = findExecutable('emcmake', 'Error: Please install the emscripten SDK: https://emscripten.org/docs/getting_started/');

const args = [
'cmake',
'-S',
Expand All @@ -167,7 +174,7 @@ function emcmakeGenerateTask() {

function cmakeBuildTask(opts) {
return () => {
const cmake = findExecutable('cmake', 'Please install CMake (e.g. "brew install cmake")');
const cmake = findExecutable('cmake', 'Error: Please install CMake (e.g. "brew install cmake")');
const args = [
'--build',
'build',
Expand Down

0 comments on commit a347ff6

Please sign in to comment.