Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Kode/kmake
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Feb 21, 2024
2 parents f60a918 + 3ebf961 commit 928f8af
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 3 deletions.
48 changes: 47 additions & 1 deletion kmake/src/Exporters/JsonExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,53 @@ export class JsonExporter extends Exporter {
this.p('"' + realfile.replace(/\\/g, '\\\\') + '",', 2);
}
}
this.p(']', 1);
this.p('],', 1);

this.p('"kongDirs":', 1);
this.p('[', 1);
for (let i = 0; i < project.getKongDirs().length; ++i) {
const kongDir = project.getKongDirs()[i];
if (i === project.getKongDirs().length - 1) {
this.p('"' + kongDir + '"', 2);
}
else {
this.p('"' + kongDir + '",', 2);
}
}
this.p('],', 1);

this.p('"name": "' + project.getName() + '",', 1);
this.p('"cStd": "' + project.getCStd() + '",', 1);

this.p('"cFlags":', 1);
this.p('[', 1);
for (let i = 0; i < project.cFlags.length; ++i) {
const cFlag = project.cFlags[i];
if (i === project.cFlags.length - 1) {
this.p('"' + cFlag + '"', 2);
}
else {
this.p('"' + cFlag + '",', 2);
}
}
this.p('],', 1);

this.p('"cppStd": "' + project.getCppStd() + '",', 1);

this.p('"cppFlags":', 1);
this.p('[', 1);
for (let i = 0; i < project.cppFlags.length; ++i) {
const cppFlag = project.cppFlags[i];
if (i === project.cppFlags.length - 1) {
this.p('"' + cppFlag + '"', 2);
}
else {
this.p('"' + cppFlag + '",', 2);
}
}
this.p('],', 1);

this.p('"debugDir": "' + project.getDebugDir().replace(/\\/g, '\\\\') + '"', 1);

this.p('}')

Expand Down
42 changes: 41 additions & 1 deletion lib/kmake/Exporters/JsonExporter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/kmake/Exporters/JsonExporter.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 928f8af

Please sign in to comment.