Skip to content

Commit f6a6e07

Browse files
committed
Fix and clean up ClCompile blocks a little
1 parent 77efdc3 commit f6a6e07

File tree

3 files changed

+19
-37
lines changed

3 files changed

+19
-37
lines changed

kmake/src/Exporters/VisualStudioExporter.ts

+13-20
Original file line numberDiff line numberDiff line change
@@ -1140,35 +1140,28 @@ export class VisualStudioExporter extends Exporter {
11401140
}
11411141
}
11421142

1143+
this.p('<ClCompile Include="' + filepath + '">', 2);
1144+
11431145
if (headerfile !== null && platform === Platform.Windows) {
1144-
this.p('<ClCompile Include="' + path.resolve(from, file) + '">', 2);
1145-
this.p('<PrecompiledHeader>Create</PrecompiledHeader>', 3);
1146-
this.p('<PrecompiledHeaderFile>' + headerfile + '</PrecompiledHeaderFile>', 3);
1147-
this.p('</ClCompile>', 2);
1146+
this.p('<PrecompiledHeader>Create</PrecompiledHeader>', 3);
1147+
this.p('<PrecompiledHeaderFile>' + headerfile + '</PrecompiledHeaderFile>', 3);
11481148
}
11491149
else if ((platform === Platform.WindowsApp || platform === Platform.XboxOne) && !file.endsWith('.winrt.cpp')) {
1150-
this.p('<ClCompile Include="' + filepath + '">', 2);
11511150
this.p('<CompileAsWinRT>false</CompileAsWinRT>', 3);
1152-
this.p('</ClCompile>', 2);
11531151
}
11541152
else {
11551153
if (fileobject.options && fileobject.options.pch && platform === Platform.Windows) {
1156-
this.p('<ClCompile Include="' + filepath + '">', 2);
1157-
this.p('<PrecompiledHeader>Use</PrecompiledHeader>', 3);
1158-
this.p('<PrecompiledHeaderFile>' + fileobject.options.pch + '</PrecompiledHeaderFile>', 3);
1159-
this.p('</ClCompile>', 2);
1160-
}
1161-
else {
1162-
if (fileobject.options && fileobject.options.nocompile) {
1163-
this.p('<ClCompile Include="' + filepath + '">', 2);
1164-
this.p('<ExcludedFromBuild>true</ExcludedFromBuild>', 3);
1165-
this.p('</ClCompile>', 2);
1166-
}
1167-
else {
1168-
this.p('<ClCompile Include="' + filepath + '" />', 2);
1169-
}
1154+
this.p('<PrecompiledHeader>Use</PrecompiledHeader>', 3);
1155+
this.p('<PrecompiledHeaderFile>' + fileobject.options.pch + '</PrecompiledHeaderFile>', 3);
11701156
}
11711157
}
1158+
1159+
if (fileobject.options && fileobject.options.nocompile) {
1160+
this.p('<ExcludedFromBuild>true</ExcludedFromBuild>', 3);
1161+
}
1162+
1163+
this.p('</ClCompile>', 2);
1164+
11721165
objects[name] = true;
11731166
}
11741167
else {

lib/kmake/Exporters/VisualStudioExporter.js

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

lib/kmake/Exporters/VisualStudioExporter.js.map

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

0 commit comments

Comments
 (0)