bindexplib: Add support for parsing and integrating .def files

This commit is contained in:
Brad King 2017-03-09 16:42:09 -05:00
parent 845c482448
commit 24361a455a

View File

@ -258,12 +258,19 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
<< "\n";
return 1;
}
std::string objfile;
std::string file;
bindexplib deffile;
while (cmSystemTools::GetLineFromStream(fin, objfile)) {
if (!deffile.AddObjectFile(objfile.c_str())) {
while (cmSystemTools::GetLineFromStream(fin, file)) {
std::string const& ext = cmSystemTools::GetFilenameLastExtension(file);
if (cmSystemTools::LowerCase(ext) == ".def") {
if (!deffile.AddDefinitionFile(file.c_str())) {
return 1;
}
} else {
if (!deffile.AddObjectFile(file.c_str())) {
return 1;
}
}
}
deffile.WriteFile(fout);
fclose(fout);