Commit 56ee545f authored by Daniel Pfeifer's avatar Daniel Pfeifer
Browse files

PCH: implementation for Visual Studio 7.0

parent 4c64450a
Pipeline #62472 passed with stage
......@@ -689,6 +689,14 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
}
}
// Precompile Headers
std::string pchHeader = target->GetPchHeader(configName, "CXX");
if (!pchHeader.empty()) {
pchHeader = this->ConvertToOutputFormat(pchHeader, SHELL);
flags += " /Yu\"" + pchHeader + "\"";
flags += " /FI\"" + pchHeader + "\"";
}
// Get preprocessor definitions for this directory.
std::string defineFlags = this->Makefile->GetDefineFlags();
Options::Tool t = Options::Compiler;
......@@ -1401,6 +1409,31 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
this->WriteGroup(&sg, target, fout, libName, configs, sourcesIndex);
}
// Precompile Headers
std::string pchSource = target->GetPchSource("", "CXX");
if (!pchSource.empty()) {
pchSource = this->ConvertToOutputFormat(pchSource, SHELL);
std::string platform =
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator)
->GetPlatformName();
fout << "\t\t<Filter\n";
fout << "\t\t\tName=\"Precompiled Header Files\"\n";
fout << "\t\t\tFilter=\"\">\n";
fout << "\t\t\t<File\n";
fout << "\t\t\t\tRelativePath=\"" << pchSource << "\">\n";
for (std::vector<std::string>::iterator i = configs.begin();
i != configs.end(); ++i) {
fout << "\t\t\t\t<FileConfiguration\n";
fout << "\t\t\t\t\tName=\"" << *i << '|' << platform << "\">\n";
fout << "\t\t\t\t\t<Tool\n";
fout << "\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n";
fout << "\t\t\t\t\t\tUsePrecompiledHeader=\"1\"/>\n";
fout << "\t\t\t\t</FileConfiguration>\n";
}
fout << "\t\t\t</File>\n";
fout << "\t\t</Filter>\n";
}
fout << "\t</Files>\n";
// Write the VCProj file's footer.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment