Skip to content

Commit

Permalink
fix: auto re-run gn gen if the args do not match (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Jan 30, 2020
1 parent 635d114 commit ca9b933
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/e-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ function runGNGen(config) {

function ensureGNGen(config) {
const buildfile = path.resolve(evmConfig.outDir(config), 'build.ninja');
if (!fs.existsSync(buildfile)) runGNGen(config);
if (!fs.existsSync(buildfile)) return runGNGen(config);
const argsFile = path.resolve(evmConfig.outDir(config), 'args.gn');
if (!fs.existsSync(argsFile)) return runGNGen(config);
const contents = fs.readFileSync(argsFile, 'utf8');
// If the current args do not match the args file, re-run gen
if (contents.trim() !== config.gen.args.join('\n').trim()) return runGNGen(config);
}

function runNinja(config, target, ninjaArgs) {
Expand Down

0 comments on commit ca9b933

Please sign in to comment.