MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / loadLibraries

Method loadLibraries

cli/cmdlineparser.cpp:2183–2208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2181}
2182
2183bool CmdLineParser::loadLibraries(Settings& settings)
2184{
2185 if (!tryLoadLibrary(settings.library, settings.exename, "std.cfg", settings.debuglookup || settings.debuglookupLibrary)) {
2186 const std::string msg("Failed to load std.cfg. Your Cppcheck installation is broken, please re-install.");
2187#ifdef FILESDIR
2188 const std::string details("The Cppcheck binary was compiled with FILESDIR set to \""
2189 FILESDIR "\" and will therefore search for "
2190 "std.cfg in " FILESDIR "/cfg.");
2191#else
2192 const std::string cfgfolder(Path::fromNativeSeparators(Path::getPathFromFilename(settings.exename)) + "cfg");
2193 const std::string details("The Cppcheck binary was compiled without FILESDIR set. Either the "
2194 "std.cfg should be available in " + cfgfolder + " or the FILESDIR "
2195 "should be configured.");
2196#endif
2197 mLogger.printRaw(msg + " " + details); // TODO: do not print as raw?
2198 return false;
2199 }
2200
2201 bool result = true;
2202 for (const auto& lib : settings.libraries) {
2203 if (!tryLoadLibrary(settings.library, settings.exename, lib.c_str(), settings.debuglookup || settings.debuglookupLibrary)) {
2204 result = false;
2205 }
2206 }
2207 return result;
2208}
2209
2210bool CmdLineParser::loadAddons(Settings& settings)
2211{

Callers

nothing calls this directly

Calls 1

printRawMethod · 0.45

Tested by

no test coverage detected