| 2181 | } |
| 2182 | |
| 2183 | bool 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 | |
| 2210 | bool CmdLineParser::loadAddons(Settings& settings) |
| 2211 | { |