Beispiel #1
0
wxString CppCheckPlugin::DoGetCommand(ProjectPtr proj)
{
    // Linux / Mac way: spawn the process and execute the command
    wxString cmd, path;
    path = clStandardPaths::Get().GetBinaryFullPath("codelite_cppcheck");
    ::WrapWithQuotes(path);

    wxString fileList = DoGenerateFileList();
    if(fileList.IsEmpty()) return wxT("");

    // build the command
    cmd << path << " ";
    cmd << m_settings.GetOptions();

    // Append here project specifc search paths
    if(proj) {
        wxArrayString projectSearchPaths = proj->GetIncludePaths();
        for(size_t i = 0; i < projectSearchPaths.GetCount(); ++i) {
            wxFileName fnIncPath(projectSearchPaths.Item(i), "");
            wxString includePath = fnIncPath.GetPath(true);
            ::WrapWithQuotes(includePath);
            cmd << " -I" << includePath;
        }

        wxArrayString projMacros = proj->GetPreProcessors();
        for(size_t i = 0; i < projMacros.GetCount(); ++i) {
            cmd << " -D" << projMacros.Item(i);
        }
    }

    cmd << wxT(" --file-list=");
    cmd << wxT("\"") << fileList << wxT("\"");
    CL_DEBUG("cppcheck command: %s", cmd);
    return cmd;
}
Beispiel #2
0
wxString CppCheckPlugin::DoGetCommand()
{
    // Linux / Mac way: spawn the process and execute the command
    wxString cmd, path;
    path = clStandardPaths::Get().GetBinaryFullPath("codelite_cppcheck");

    wxString fileList = DoGenerateFileList();
    if(fileList.IsEmpty())
        return wxT("");

    // build the command
    cmd << wxT("\"") << path << wxT("\" ");
    cmd << m_settings.GetOptions();
    cmd << wxT(" --file-list=");
    cmd << wxT("\"") << fileList << wxT("\"");
    return cmd;
}