Skip to content

Commit c115c52

Browse files
author
Felix Faber
committed
Fixing up errors I introduced during rebasing, sorry!
1 parent 7933939 commit c115c52

1 file changed

Lines changed: 6 additions & 29 deletions

File tree

lib/importproject.cpp

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -451,30 +451,7 @@ bool ImportProject::importSln(std::istream &istr, const std::string &path, const
451451
std::vector<SharedItemsProject> sharedItemsProjects{};
452452
while (std::getline(istr,line)) {
453453
if (!startsWith(line,"Project("))
454-
continue;
455-
456-
// NOTE(Felix): Custom code for vcxitems
457-
{
458-
const std::string::size_type pos = line.find(".vcxitems");
459-
if (pos != std::string::npos)
460-
{
461-
const std::string::size_type pos1 = line.rfind('\"', pos);
462-
if (pos1 != std::string::npos)
463-
{
464-
std::string vcxitems(line.substr(pos1 + 1, pos - pos1 + 8));
465-
vcxitems = Path::toNativeSeparators(std::move(vcxitems));
466-
if (!Path::isAbsolute(vcxitems))
467-
vcxitems = path + vcxitems;
468-
vcxitems = Path::fromNativeSeparators(std::move(vcxitems));
469-
if (!importVcxitems(vcxitems, variables, emptyString, fileFilters)) {
470-
printError("failed to load '" + vcxitems + "' from Visual Studio solution");
471-
return false;
472-
}
473-
found = true;
474-
}
475-
}
476-
}
477-
454+
continue;
478455
const std::string::size_type pos = line.find(".vcxproj");
479456
if (pos == std::string::npos)
480457
continue;
@@ -486,7 +463,7 @@ bool ImportProject::importSln(std::istream &istr, const std::string &path, const
486463
if (!Path::isAbsolute(vcxproj))
487464
vcxproj = path + vcxproj;
488465
vcxproj = Path::fromNativeSeparators(std::move(vcxproj));
489-
if (!importVcxproj(vcxproj, variables, emptyString, fileFilters)) {
466+
if (!importVcxproj(vcxproj, variables, emptyString, fileFilters, sharedItemsProjects)) {
490467
printError("failed to load '" + vcxproj + "' from Visual Studio solution");
491468
return false;
492469
}
@@ -835,9 +812,9 @@ bool ImportProject::importVcxproj(const std::string &filename, std::map<std::str
835812
fs.useMfc = useOfMfc;
836813
fs.defines = "_WIN32=1";
837814
if (p.platform == ProjectConfiguration::Win32)
838-
fs.platformType = cppcheck::Platform::Type::Win32W;
815+
fs.platformType = Platform::Type::Win32W;
839816
else if (p.platform == ProjectConfiguration::x64) {
840-
fs.platformType = cppcheck::Platform::Type::Win64;
817+
fs.platformType = Platform::Type::Win64;
841818
fs.defines += ";_WIN64=1";
842819
}
843820
std::string additionalIncludePaths;
@@ -858,8 +835,8 @@ bool ImportProject::importVcxproj(const std::string &filename, std::map<std::str
858835
fs.defines += ";__AVX512__";
859836
additionalIncludePaths += ';' + i.additionalIncludePaths;
860837
}
861-
fs.setDefines(fs.defines);
862-
fs.setIncludePaths(Path::getPathFromFilename(filename), toStringList(includePath + ';' + additionalIncludePaths), variables);
838+
fsSetDefines(fs, fs.defines);
839+
fsSetIncludePaths(fs, Path::getPathFromFilename(filename), toStringList(includePath + ';' + additionalIncludePaths), variables);
863840
for (const auto &path : sharedItemsIncludePaths) {
864841
fs.includePaths.emplace_back(path);
865842
}

0 commit comments

Comments
 (0)