Skip to content

Commit

Permalink
ninja: less rule name suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
refack committed Feb 5, 2017
1 parent c1fbf87 commit 7e0d7c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/gyp/generator/ninja/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,11 @@ Ninja.prototype.actions = function actions() {

let res = [];
list.forEach((action) => {
const actionRule = action.action_name.replace(/\s/g, '_') + '_' + this.index;
const safeActionName = action.action_name.replace(/\s/g, '_');
global.action_names = (global.action_names || {});
const counterRef = global.action_names[safeActionName] || (global.action_names[safeActionName] = {counter: 0});
const actionRule = safeActionName + (counterRef.counter || '');
counterRef.counter++;

const base = gyp.common.cachedRelative(this.configDir, this.srcDir);
const toBase = gyp.common.cachedRelative(this.srcDir, this.configDir);
Expand Down Expand Up @@ -660,6 +664,7 @@ NinjaMain.prototype.hostVars = function hostVars(target) {
main.declare('ld_host', ld);
main.declare('ldxx_host', ldxx);
main.declare('ar_host', ar);

};

NinjaMain.prototype.rulesAndTargets = function rulesAndTargets() {
Expand Down

0 comments on commit 7e0d7c9

Please sign in to comment.