@@ -450,30 +450,7 @@ bool ImportProject::importSln(std::istream &istr, const std::string &path, const
450450 std::vector<SharedItemsProject> sharedItemsProjects{};
451451 while (std::getline (istr,line)) {
452452 if (!startsWith (line," Project(" ))
453- continue ;
454-
455- // NOTE(Felix): Custom code for vcxitems
456- {
457- const std::string::size_type pos = line.find (" .vcxitems" );
458- if (pos != std::string::npos)
459- {
460- const std::string::size_type pos1 = line.rfind (' \" ' , pos);
461- if (pos1 != std::string::npos)
462- {
463- std::string vcxitems (line.substr (pos1 + 1 , pos - pos1 + 8 ));
464- vcxitems = Path::toNativeSeparators (std::move (vcxitems));
465- if (!Path::isAbsolute (vcxitems))
466- vcxitems = path + vcxitems;
467- vcxitems = Path::fromNativeSeparators (std::move (vcxitems));
468- if (!importVcxitems (vcxitems, variables, emptyString, fileFilters)) {
469- printError (" failed to load '" + vcxitems + " ' from Visual Studio solution" );
470- return false ;
471- }
472- found = true ;
473- }
474- }
475- }
476-
453+ continue ;
477454 const std::string::size_type pos = line.find (" .vcxproj" );
478455 if (pos == std::string::npos)
479456 continue ;
@@ -485,7 +462,7 @@ bool ImportProject::importSln(std::istream &istr, const std::string &path, const
485462 if (!Path::isAbsolute (vcxproj))
486463 vcxproj = path + vcxproj;
487464 vcxproj = Path::fromNativeSeparators (std::move (vcxproj));
488- if (!importVcxproj (vcxproj, variables, emptyString, fileFilters)) {
465+ if (!importVcxproj (vcxproj, variables, emptyString, fileFilters, sharedItemsProjects )) {
489466 printError (" failed to load '" + vcxproj + " ' from Visual Studio solution" );
490467 return false ;
491468 }
@@ -834,9 +811,9 @@ bool ImportProject::importVcxproj(const std::string &filename, std::map<std::str
834811 fs.useMfc = useOfMfc;
835812 fs.defines = " _WIN32=1" ;
836813 if (p.platform == ProjectConfiguration::Win32)
837- fs.platformType = cppcheck:: Platform::Type::Win32W;
814+ fs.platformType = Platform::Type::Win32W;
838815 else if (p.platform == ProjectConfiguration::x64) {
839- fs.platformType = cppcheck:: Platform::Type::Win64;
816+ fs.platformType = Platform::Type::Win64;
840817 fs.defines += " ;_WIN64=1" ;
841818 }
842819 std::string additionalIncludePaths;
@@ -857,8 +834,8 @@ bool ImportProject::importVcxproj(const std::string &filename, std::map<std::str
857834 fs.defines += " ;__AVX512__" ;
858835 additionalIncludePaths += ' ;' + i.additionalIncludePaths ;
859836 }
860- fs. setDefines ( fs.defines );
861- fs. setIncludePaths ( Path::getPathFromFilename (filename), toStringList (includePath + ' ;' + additionalIncludePaths), variables);
837+ fsSetDefines (fs, fs.defines );
838+ fsSetIncludePaths (fs, Path::getPathFromFilename (filename), toStringList (includePath + ' ;' + additionalIncludePaths), variables);
862839 for (const auto &path : sharedItemsIncludePaths) {
863840 fs.includePaths .emplace_back (path);
864841 }
0 commit comments