Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxy-v committed Sep 1, 2024
1 parent 2b19239 commit 8090cf5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions scripts/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ module.exports = (sources) => {
let outputs = [];
console.log(sources);
let commands = JSON.parse(fs.readFileSync('build/compile_commands.json', 'utf8'));
for (let {'file': src, ..._} of sources) {
if (src.endsWith('.cpp') || src.endsWith('.h') || src.endsWith('.c')
|| src.endsWith('.hpp')) {
const idx = commands.findIndex(entry => entry.file.endsWith(src));
for (let {file, ...rest} of sources) {
if (file.endsWith('.cpp') || file.endsWith('.h') || file.endsWith('.c')
|| file.endsWith('.hpp')) {
const idx = commands.findIndex(entry => entry.file.endsWith(file));
if (idx >= 0) {
let entry = commands[idx];
if (entry.output !== 'undefined') {
Expand All @@ -28,19 +28,19 @@ module.exports = (sources) => {

let insert = false;
for (const line of lines) {
if (line.endsWith('outputs:')) {
insert = true;
continue;
}
const value = line.trim();
if (insert && value.length > 0) {
level_targets.add(value);
if (line.endsWith('outputs:')) {
insert = true;
continue;
}
const value = line.trim();
if (insert && value.length > 0) {
level_targets.add(value);
}
}
}
}

outputs = [...level_targets];
targets = new Set([...targets, ...level_targets]);
outputs = [...level_targets];
targets = new Set([...targets, ...level_targets]);
}
return [...targets].join(' ');
}

0 comments on commit 8090cf5

Please sign in to comment.