Skip to content

Commit

Permalink
Add an option to not compile specific files
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 1, 2024
1 parent b8a220c commit 1a2e5df
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
12 changes: 11 additions & 1 deletion kmake/src/Exporters/VisualStudioExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,14 @@ export class VisualStudioExporter extends Exporter {
this.p('</ClCompile>', 2);
}
else {
this.p('<ClCompile Include="' + filepath + '" />', 2);
if (fileobject.options && fileobject.options.nocompile) {
this.p('<ClCompile Include="' + filepath + '">', 2);
this.p('<ExcludedFromBuild>true</ExcludedFromBuild>', 3);
this.p('</ClCompile>', 2);
}
else {
this.p('<ClCompile Include="' + filepath + '" />', 2);
}
}
}
objects[name] = true;
Expand All @@ -1173,6 +1180,9 @@ export class VisualStudioExporter extends Exporter {
if ((platform === Platform.WindowsApp || platform === Platform.XboxOne) && !file.endsWith('.winrt.cpp')) {
this.p('<CompileAsWinRT>false</CompileAsWinRT>', 3);
}
if (fileobject.options && fileobject.options.nocompile) {
this.p('<ExcludedFromBuild>true</ExcludedFromBuild>', 3);
}
this.p('</ClCompile>', 2);
objects[name] = true;
}
Expand Down
12 changes: 11 additions & 1 deletion lib/kmake/Exporters/VisualStudioExporter.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/VisualStudioExporter.js.map

Large diffs are not rendered by default.

0 comments on commit 1a2e5df

Please sign in to comment.