Skip to content

Commit 77efdc3

Browse files
committed
Support the nocompile option everywhere
1 parent 5b5b12b commit 77efdc3

20 files changed

+51
-9
lines changed

kmake/src/Exporters/CMakeExporter.ts

+4
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ export class CMakeExporter extends Exporter {
158158
let files = '';
159159
for (let file of project.getFiles()) {
160160
if (file.file.endsWith('.c') || file.file.endsWith('.cc') || file.file.endsWith('.cpp') || file.file.endsWith('.h')) {
161+
if (file.options && file.options.nocompile) {
162+
continue;
163+
}
164+
161165
files += ' "' + path.resolve(file.file).replace(/\\/g, '/') + '"\n';
162166
}
163167
}

kmake/src/Exporters/CompileCommandsExporter.ts

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export class CompilerCommandsExporter extends Exporter {
3333
for (let fileobject of project.getFiles()) {
3434
let file = fileobject.file;
3535
if (file.endsWith('.cpp') || file.endsWith('.c') || file.endsWith('.cc') || file.endsWith('.s') || file.endsWith('.S')) {
36+
if (fileobject.options && fileobject.options.nocompile) {
37+
continue;
38+
}
39+
3640
let name = file.toLowerCase();
3741
if (name.indexOf('/') >= 0) name = name.substr(name.lastIndexOf('/') + 1);
3842
name = name.substr(0, name.lastIndexOf('.'));

kmake/src/Exporters/FreeBSDExporter.ts

+4
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ export class FreeBSDExporter extends Exporter {
187187
for (let fileobject of project.getFiles()) {
188188
let file = fileobject.file;
189189
if (file.endsWith('.c') || file.endsWith('.cpp') || file.endsWith('.cc') || file.endsWith('.s') || file.endsWith('.S')) {
190+
if (fileobject.options && fileobject.options.nocompile) {
191+
continue;
192+
}
193+
190194
this.p();
191195
let name = ofiles[file];
192196
let realfile = path.relative(outputPath, path.resolve(from, file));

kmake/src/Exporters/LinuxExporter.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ export class LinuxExporter extends Exporter {
207207

208208
if (file.file.endsWith('.c') || file.file.endsWith('.cc') || file.file.endsWith('.cpp')) {
209209
this.p('<Unit filename="' + path.resolve(from, file.file) + '">', 2);
210-
this.p('<Option compilerVar="CC" />', 3);
210+
if (!file.options || !file.options.nocompile) {
211+
this.p('<Option compilerVar="CC" />', 3);
212+
}
211213
this.p('</Unit>', 2);
212214
}
213215
else if (file.file.endsWith('.h')) {

kmake/src/Exporters/MakeExporter.ts

+4
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ export class MakeExporter extends Exporter {
181181
for (let fileobject of project.getFiles()) {
182182
let file = fileobject.file;
183183
if (file.endsWith('.c') || file.endsWith('.cpp') || file.endsWith('.cc') || file.endsWith('.s') || file.endsWith('.S')) {
184+
if (fileobject.options && fileobject.options.nocompile) {
185+
continue;
186+
}
187+
184188
this.p();
185189
let name = ofiles[file];
186190
let realfile = path.relative(outputPath, path.resolve(from, file));

kmake/src/Exporters/NinjaExporter.ts

+4
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ export class NinjaExporter extends Exporter {
142142
for (let fileobject of project.getFiles()) {
143143
let file = fileobject.file;
144144
if (file.endsWith('.c') || file.endsWith('.cpp') || file.endsWith('.cc') || file.endsWith('.s') || file.endsWith('.S')) {
145+
if (fileobject.options && fileobject.options.nocompile) {
146+
continue;
147+
}
148+
145149
this.p();
146150
let name = ofiles[file];
147151
let realfile = path.relative(outputPath, path.resolve(from, file));

lib/kmake/Exporters/AndroidExporter.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/kmake/Exporters/AndroidExporter.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/kmake/Exporters/CMakeExporter.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/kmake/Exporters/CMakeExporter.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/kmake/Exporters/CompileCommandsExporter.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)