• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ clBuildEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中clBuildEvent的典型用法代码示例。如果您正苦于以下问题:C++ clBuildEvent类的具体用法?C++ clBuildEvent怎么用?C++ clBuildEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了clBuildEvent类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OnBuildStarting

void ClangCodeCompletion::OnBuildStarting(clBuildEvent& e)
{
    e.Skip();
    CHECK_CLANG_ENABLED_RET();

    // Determine the compilation database
    CompilationDatabase cdb;
    cdb.Open();
    cdb.Close();

    // Set the compilation database environment variable
    ::wxSetEnv(wxT("CL_COMPILATION_DB"), cdb.GetFileName().GetFullPath());

    // If this is NOT a custom project, set the CXX and CC environment
    wxString  project = e.GetProjectName();
    wxString  config  = e.GetConfigurationName();
    
    BuildConfigPtr bldConf = WorkspaceST::Get()->GetProjBuildConf(project, config);
    if( bldConf && !bldConf->IsCustomBuild()) {
        wxString cxx = bldConf->GetCompiler()->GetTool(wxT("CXX"));
        wxString cc  = bldConf->GetCompiler()->GetTool(wxT("CC"));
        
        cxx.Prepend(wxT("codelitegcc "));
        cc.Prepend(wxT("codelitegcc "));
        
        ::wxSetEnv("CXX", cxx);
        ::wxSetEnv("CC" ,  cc);
    }
}
开发者ID:ecmadrid,项目名称:codelite,代码行数:29,代码来源:clang_code_completion.cpp


示例2: OnBuildStarting

void QMakePlugin::OnBuildStarting(clBuildEvent& event)
{
    // call Skip() to allow the standard compilation to take place
    event.Skip();

    QmakePluginData::BuildConfPluginData bcpd;
    wxString project = event.GetProjectName();
    wxString config = event.GetConfigurationName();

    if(!DoGetData(project, config, bcpd)) { return; }

    if(!bcpd.m_enabled) { return; }

    // OK this is a qmake project
    event.Skip(false);

    wxString errMsg;
    ProjectPtr p = m_mgr->GetWorkspace()->FindProjectByName(project, errMsg);
    if(!p) { return; }
    QMakeProFileGenerator generator(m_mgr, project, config);
    if(!wxFileName::Exists(generator.GetProFileName())) {
        // alert and return
        ::wxMessageBox(_("Could not locate pro file.\nDid you remember to run qmake? (right click on the project"),
                       "QMake", wxICON_WARNING | wxCENTER);
        return;
    } else {
        event.Skip();
    }
}
开发者ID:eranif,项目名称:codelite,代码行数:29,代码来源:qmakeplugin.cpp


示例3: OnBuildStarting

void QMakePlugin::OnBuildStarting(clBuildEvent& event)
{
    // call Skip() to allow the standard compilation to take place
    event.Skip();

    QmakePluginData::BuildConfPluginData bcpd;
    wxString  project = event.GetProjectName();
    wxString  config  = event.GetConfigurationName();

    if ( !DoGetData(project, config, bcpd) ) {
        return;
    }

    if ( !bcpd.m_enabled ) {
        return;
    }

    wxString errMsg;
    ProjectPtr p = m_mgr->GetWorkspace()->FindProjectByName(project, errMsg);
    if ( !p ) {
        return;
    }
    QMakeProFileGenerator generator(m_mgr, project, config);

    // regenrate the .pro file
    bool needRegeneration = generator.Generate();

    wxString qmake_exe = m_conf->Read(wxString::Format(wxT("%s/qmake"),     bcpd.m_qmakeConfig.c_str()));
    wxString qmakespec = m_conf->Read(wxString::Format(wxT("%s/qmakespec"), bcpd.m_qmakeConfig.c_str()));
    wxString qtdir     = m_conf->Read(wxString::Format(wxT("%s/qtdir"),     bcpd.m_qmakeConfig.c_str()));

    // Create qmake comand
    wxString qmake_exe_line;
    qmake_exe.Trim().Trim(false);
    qmakespec.Trim().Trim(false);

    // Set QTDIR
    DirSaver ds;
    {

        wxSetWorkingDirectory ( p->GetFileName().GetPath(wxPATH_GET_SEPARATOR|wxPATH_GET_VOLUME) );
        wxSetEnv(wxT("QTDIR"), qtdir);
        qmake_exe_line << wxT("\"") << qmake_exe << wxT("\" -spec ") << qmakespec << wxT(" ") << generator.GetProFileName();

        if ( needRegeneration ) {
            wxArrayString output;
            ProcUtils::SafeExecuteCommand(qmake_exe_line, output);
        }

    }
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:51,代码来源:qmakeplugin.cpp


示例4: GetSettingsManager

void
CMakePlugin::ProcessBuildEvent(clBuildEvent& event, wxString param)
{
    wxString project = event.GetProjectName();
    const wxString config  = event.GetConfigurationName();

    // Get settings
    const CMakeProjectSettings* settings = GetSettingsManager()->GetProjectSettings(project, config);

    // Doesn't exists or not enabled
    if (!settings || !settings->enabled) {
        // Unable to export makefile
        event.Skip();
        return;
    }

    // Project has parent project
    if (!settings->parentProject.IsEmpty()) {
        // Add project name as target
        param = project + " " + param;
        // Build parent project
        project = settings->parentProject;
    }

    // Workspace directory
    const wxFileName workspaceDir = GetWorkspaceDirectory();

    // Use relative path
    wxFileName projectDir = GetProjectDirectory(project);
    projectDir.MakeRelativeTo(workspaceDir.GetFullPath());

    const wxString projectDirEsc = projectDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);

    // Build command
    wxString cmd = "$(MAKE)";

    if (!projectDirEsc.IsEmpty())
        cmd += " -C \"" + projectDirEsc + "\"";

    // Add makefile
    cmd += " -f \"" + project + ".mk\"";

    // Add optional parameters
    if (!param.IsEmpty())
        cmd += " " + param;

    // The build command is simple make call with different makefile
    event.SetCommand(cmd);
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:49,代码来源:CMakePlugin.cpp


示例5: OnBuildEnded

void CodeCompletionManager::OnBuildEnded(clBuildEvent& e)
{
    e.Skip();
    DoUpdateCompilationDatabase();
    DoProcessCompileCommands();
    m_buildInProgress = false;
}
开发者ID:jiapei100,项目名称:codelite,代码行数:7,代码来源:code_completion_manager.cpp


示例6: OnBuildStarting

void LLDBPlugin::OnBuildStarting(clBuildEvent& event)
{
    if(m_connector.IsRunning()) {
        // lldb session is active, prompt the user
        if(::wxMessageBox(_("A debug session is running\nCancel debug session and continue building?"), "CodeLite",
                          wxICON_QUESTION | wxYES_NO | wxYES_DEFAULT | wxCENTER) == wxYES) {
            clDebugEvent dummy;
            OnDebugStop(dummy);
            event.Skip();
        } else {
            // do nothing - this will cancel the build
        }

    } else {
        event.Skip();
    }
}
开发者ID:eranif,项目名称:codelite,代码行数:17,代码来源:LLDBPlugin.cpp


示例7: OnGetIsPluginMakefile

void CMakePlugin::OnGetIsPluginMakefile(clBuildEvent& event)
{
    wxString project = event.GetProjectName();
    const wxString config = event.GetConfigurationName();

    // Get settings
    const CMakeProjectSettings* settings = GetSettingsManager()->GetProjectSettings(project, config);

    // Doesn't exists or not enabled
    if(!settings || !settings->enabled) {
        // Cannot provide custom makefile
        event.Skip();
        return;
    }

    // Custom makefile is provided
}
开发者ID:kaustubhcs,项目名称:codelite,代码行数:17,代码来源:CMakePlugin.cpp


示例8: OnGetIsPluginMakefile

void QMakePlugin::OnGetIsPluginMakefile(clBuildEvent& event)
{
    QmakePluginData::BuildConfPluginData bcpd;

    wxString project = event.GetProjectName();
    wxString config  = event.GetConfigurationName();

    if ( !DoGetData(project, config, bcpd) ) {
        event.Skip();
        return;
    }

    if ( bcpd.m_enabled ) {
        // return without calling event.Skip()
        return;
    }
    event.Skip();
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:18,代码来源:qmakeplugin.cpp


示例9: OnBuildEnded

void ClangCodeCompletion::OnBuildEnded(clBuildEvent& e)
{
    e.Skip();
    CHECK_CLANG_ENABLED_RET();

    // Clear environment variables previously set by this class
    ::wxUnsetEnv("CL_COMPILATION_DB");
    ::wxUnsetEnv("CXX");
    ::wxUnsetEnv("CC");

    // Clear the TU cache
    ClearCache();
}
开发者ID:ecmadrid,项目名称:codelite,代码行数:13,代码来源:clang_code_completion.cpp


示例10: OnBuildEnded

void ClangCodeCompletion::OnBuildEnded(clBuildEvent& e)
{
    e.Skip();
    CHECK_CLANG_ENABLED_RET();

    // Clear environment variables previously set by this class
    ::wxUnsetEnv(wxT("CL_COMPILATION_DB"));
    ::wxUnsetEnv(wxT("CXX"));
    ::wxUnsetEnv(wxT("CC"));
    
    // Create a worker thread (detached thread) that 
    // will initialize the database now that the compilation is ended
    CompilationDatabase db;
    ClangCompilationDbThread* thr = new ClangCompilationDbThread( db.GetFileName().GetFullPath() );
    thr->Start();
    
    // Clear the TU cache
    ClearCache();
}
开发者ID:Hmaal,项目名称:codelite,代码行数:19,代码来源:clang_code_completion.cpp


示例11: OnGetCleanCommand

void QMakePlugin::OnGetCleanCommand(clBuildEvent& event)
{
    QmakePluginData::BuildConfPluginData bcpd;

    wxString  project = event.GetProjectName();
    wxString  config  = event.GetConfigurationName();

    if ( !DoGetData(project, config, bcpd) ) {
        event.Skip();
        return;
    }

    if ( !bcpd.m_enabled ) {
        event.Skip();
        return;
    }

    event.SetCommand( DoGetBuildCommand(project, config, event.IsProjectOnly()) + wxT(" clean") );
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:19,代码来源:qmakeplugin.cpp


示例12: OnGetBuildCommand

void QMakePlugin::OnGetBuildCommand(clBuildEvent& event)
{
    QmakePluginData::BuildConfPluginData bcpd;

    wxString  project = event.GetProjectName();
    wxString  config  = event.GetConfigurationName();

    if ( !DoGetData(project, config, bcpd) ) {
        event.Skip();
        return;
    }

    if ( !bcpd.m_enabled ) {
        event.Skip();
        return;
    }

    // we avoid calling event.Skip() to override the default build system by this one
    event.SetCommand( DoGetBuildCommand(project, config, event.IsProjectOnly()) );
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:20,代码来源:qmakeplugin.cpp


示例13: OnBuildEnded

void OutputPane::OnBuildEnded(clBuildEvent& e)
{
    e.Skip();
    m_buildInProgress = false;
}
开发者ID:292388900,项目名称:codelite,代码行数:5,代码来源:output_pane.cpp


示例14: file

void
CMakePlugin::OnExportMakefile(clBuildEvent& event)
{
    const wxString project = event.GetProjectName();
    const wxString config  = event.GetConfigurationName();

    // Get settings
    const CMakeProjectSettings* settings = GetSettingsManager()->GetProjectSettings(project, config);

    // Doesn't exists or not enabled
    if (!settings || !settings->enabled) {
        // Unable to export makefile
        event.Skip();
        return;
    }

    // Get project directory - this is directory where the makefile is stored
    const wxFileName projectDir = GetProjectDirectory(project);

    // Targets forward inspired by
    // https://gist.github.com/doitian/4978329

    // Content of the generated makefile
    wxString content = wxString() <<
        "# Generated by CMakePlugin\n"
        ".PHONY: all clean $(MAKECMDGOALS)\n"
        "\n"
    ;

    // Parent project is set
    if (!settings->parentProject.IsEmpty()) {
        // Configure parent project instead
        const wxString& parentProject = settings->parentProject;
        settings = GetSettingsManager()->GetProjectSettings(parentProject, config);

        // Parent project not found
        if (!settings || !settings->enabled) {
            CL_ERROR("Unable to find or not enabled parent project "
                "'" + parentProject + "' for project '" + project + "'");
            return;
        }

        // Get parent project directory
        wxFileName parentProjectDir = GetProjectDirectory(parentProject);
        parentProjectDir.MakeRelativeTo(projectDir.GetFullPath());

        // Path is relative so UNIX path system can be used
        const wxString parentProjectDirEsc = parentProjectDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);

        // Redirect make to the parent project
        content <<
            "# Parent project\n"
            "PARENT          := " << parentProjectDirEsc << "\n"
            "PARENT_MAKEFILE := " << parentProject << ".mk\n"
            "\n"
            "all:\n"
            "\t$(MAKE) -C \"$(PARENT)\" -f \"$(PARENT_MAKEFILE)\" " << project << "\n"
            "\n"
            "clean:\n"
            "\t$(MAKE) -C \"$(PARENT)\" -f \"$(PARENT_MAKEFILE)\" " << project << " clean\n"
            "\n"
        ;

    } else {

        // Macro expander
        // FIXME use IMacroManager (unable to find it yet)
        MacroManager* macro = MacroManager::Instance();
        wxASSERT(macro);

        // Get variables
        // Expand variables for final project
        const wxString cmake = GetConfiguration()->GetProgramPath();
        wxFileName sourceDir = wxFileName::DirName(macro->Expand(settings->sourceDirectory, GetManager(), project, config));
        wxFileName buildDir = wxFileName::DirName(macro->Expand(settings->buildDirectory, GetManager(), project, config));

        // Source dir must be relative to build directory (here is cmake called)
        sourceDir.MakeRelativeTo(buildDir.GetFullPath());
        // Build dir must be relative to project directory
        buildDir.MakeRelativeTo(projectDir.GetFullPath());

        // Relative paths
        const wxString sourceDirEsc = sourceDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);
        const wxString buildDirEsc = buildDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);

        // Generated makefile
        content <<
            "CMAKE      := \"" << cmake << "\"\n"
            "BUILD_DIR  := " << buildDirEsc << "\n"
            "SOURCE_DIR := " << sourceDirEsc << "\n"
            "CMAKE_ARGS := " << CreateArguments(*settings, *m_configuration.get()) << "\n"
            "\n"
            "# Building project(s)\n"
            "$(or $(lastword $(MAKECMDGOALS)), all): $(BUILD_DIR)/Makefile\n"
            "\t$(MAKE) -C \"$(BUILD_DIR)\" $(MAKECMDGOALS)\n"
            "\n"
            "# Building directory\n"
            "$(BUILD_DIR):\n"
            "\t$(CMAKE) -E make_directory \"$(BUILD_DIR)\"\n"
            "\n"
//.........这里部分代码省略.........
开发者ID:AndrianDTR,项目名称:codelite,代码行数:101,代码来源:CMakePlugin.cpp


示例15: OnBuildStarted

void CodeCompletionManager::OnBuildStarted(clBuildEvent& e)
{
    e.Skip();
    m_buildInProgress = true;
}
开发者ID:linweixin,项目名称:codelite,代码行数:5,代码来源:code_completion_manager.cpp


示例16: OnBuildEnded

void CodeCompletionManager::OnBuildEnded(clBuildEvent& e)
{
    e.Skip();
    DoUpdateCompilationDatabase();
}
开发者ID:ecmadrid,项目名称:codelite,代码行数:5,代码来源:code_completion_manager.cpp


示例17: OnBuildStarted

void OutputPane::OnBuildStarted(clBuildEvent& e)
{
    e.Skip();
    m_buildInProgress = true;
}
开发者ID:292388900,项目名称:codelite,代码行数:5,代码来源:output_pane.cpp



注:本文中的clBuildEvent类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ clCodeCompletionEvent类代码示例发布时间:2022-05-31
下一篇:
C++ ciSignature类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap