mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer (MSVC): Fix multi-arch PCH project generation
Co-authored-by: Ryaan Ahmed <ryaan.ahmed@bandlab.com>
This commit is contained in:
parent
243d3756fc
commit
522217d9c5
1 changed files with 24 additions and 24 deletions
|
|
@ -1350,38 +1350,38 @@ public:
|
||||||
|
|
||||||
auto& config = *static_cast<const MSVCBuildConfiguration*> (&*i);
|
auto& config = *static_cast<const MSVCBuildConfiguration*> (&*i);
|
||||||
|
|
||||||
for (const auto& arch : config.getArchitectures())
|
auto pchFileContent = config.getPrecompiledHeaderFileContent();
|
||||||
|
|
||||||
|
if (pchFileContent.isEmpty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
auto pchFile = owner.getTargetFolder().getChildFile (config.getPrecompiledHeaderFilename())
|
||||||
|
.withFileExtension (".h");
|
||||||
|
|
||||||
|
build_tools::writeStreamToFile (pchFile, [&] (MemoryOutputStream& mo)
|
||||||
{
|
{
|
||||||
auto pchFileContent = config.getPrecompiledHeaderFileContent();
|
mo << pchFileContent;
|
||||||
|
});
|
||||||
|
|
||||||
if (pchFileContent.isEmpty())
|
auto pchSourceFile = pchFile.withFileExtension (".cpp");
|
||||||
continue;
|
|
||||||
|
|
||||||
auto pchFile = owner.getTargetFolder().getChildFile (config.getPrecompiledHeaderFilename()).withFileExtension (".h");
|
build_tools::writeStreamToFile (pchSourceFile, [this] (MemoryOutputStream& mo)
|
||||||
|
{
|
||||||
|
mo.setNewLineString (owner.getNewLineString());
|
||||||
|
|
||||||
build_tools::writeStreamToFile (pchFile, [&] (MemoryOutputStream& mo)
|
writeAutoGenWarningComment (mo);
|
||||||
{
|
|
||||||
mo << pchFileContent;
|
|
||||||
});
|
|
||||||
|
|
||||||
auto pchSourceFile = pchFile.withFileExtension (".cpp");
|
mo << " This is an empty source file generated by JUCE required for Visual Studio PCH." << newLine
|
||||||
|
<< newLine
|
||||||
|
<< "*/" << newLine
|
||||||
|
<< newLine;
|
||||||
|
});
|
||||||
|
|
||||||
build_tools::writeStreamToFile (pchSourceFile, [this] (MemoryOutputStream& mo)
|
auto* pchSourceElement = cpps.createNewChildElement ("ClCompile");
|
||||||
{
|
pchSourceElement->setAttribute ("Include", prependDot (pchSourceFile.getFileName()));
|
||||||
mo.setNewLineString (owner.getNewLineString());
|
|
||||||
|
|
||||||
writeAutoGenWarningComment (mo);
|
for (const auto& arch : config.getArchitectures())
|
||||||
|
|
||||||
mo << " This is an empty source file generated by JUCE required for Visual Studio PCH." << newLine
|
|
||||||
<< newLine
|
|
||||||
<< "*/" << newLine
|
|
||||||
<< newLine;
|
|
||||||
});
|
|
||||||
|
|
||||||
auto* pchSourceElement = cpps.createNewChildElement ("ClCompile");
|
|
||||||
pchSourceElement->setAttribute ("Include", prependDot (pchSourceFile.getFileName()));
|
|
||||||
setSourceFilePCHSettings (*pchSourceElement, pchFile, "Create", config, arch);
|
setSourceFilePCHSettings (*pchSourceElement, pchFile, "Create", config, arch);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue