当前位置: 首页>>代码示例>>C++>>正文


C++ ProjectBuildTarget::AddCommandsAfterBuild方法代码示例

本文整理汇总了C++中ProjectBuildTarget::AddCommandsAfterBuild方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectBuildTarget::AddCommandsAfterBuild方法的具体用法?C++ ProjectBuildTarget::AddCommandsAfterBuild怎么用?C++ ProjectBuildTarget::AddCommandsAfterBuild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectBuildTarget的用法示例。


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

示例1: if


//.........这里部分代码省略.........
            if (!m_ConvertSwitches)
            {
                tmp = cbC2U(tool->Attribute("Detect64BitPortabilityProblems"));
                if (tmp.IsSameAs(_T("TRUE")))
                    bt->AddCompilerOption(_T("/Wp64"));

                tmp = cbC2U(tool->Attribute("MinimalRebuild"));
                if (tmp.IsSameAs(_T("TRUE")))
                    bt->AddCompilerOption(_T("/Gm"));
/*
                RuntimeLibrary :
                rtMultiThreaded          0 --> /MT
                rtMultiThreadedDebug     1 --> /MTd
                rtMultiThreadedDLL       2 --> /MD
                rtMultiThreadedDebugDLL  3 --> /MDd
                rtSingleThreaded         4 --> /ML
                rtSingleThreadedDebug    5 --> /MLd
*/
                tmp = cbC2U(tool->Attribute("RuntimeLibrary"));
                if      (tmp.IsSameAs(_T("0"))) bt->AddCompilerOption(_T("/MT"));
                else if (tmp.IsSameAs(_T("1"))) bt->AddCompilerOption(_T("/MTd"));
                else if (tmp.IsSameAs(_T("2"))) bt->AddCompilerOption(_T("/MD"));
                else if (tmp.IsSameAs(_T("3"))) bt->AddCompilerOption(_T("/MDd"));
                else if (tmp.IsSameAs(_T("4"))) bt->AddCompilerOption(_T("/ML"));
                else if (tmp.IsSameAs(_T("5"))) bt->AddCompilerOption(_T("/MLd"));

#if 0
                tmp = cbC2U(tool->Attribute("SuppressStartupBanner"));
                if (tmp.IsSameAs(_T("TRUE"))) bt->AddCompilerOption("/nologo");
#endif
/*
                runtimeBasicCheckNone 0
                runtimeCheckStackFrame 1  --> /RTCs or /GZ
                runtimeCheckUninitVariables 2
                runtimeBasicCheckAll 3
*/
                tmp = cbC2U(tool->Attribute("BasicRuntimeChecks"));
                if (tmp.IsSameAs(_T("1")))
                    bt->AddCompilerOption(_T("/GZ"));

                tmp = cbC2U(tool->Attribute("ExceptionHandling"));
                if (tmp.IsSameAs(_T("TRUE"))) bt->AddCompilerOption(_T("EHsc")); // add C++ exception handling

            }

            tmp = cbC2U(tool->Attribute("RuntimeTypeInfo"));
            if (tmp.IsSameAs(_T("TRUE")))
                bt->AddCompilerOption(m_ConvertSwitches ? _T("-frtti") : _T("/GR"));

/*
            AdditionalOptions=" /Zm1000 /GR  -DCMAKE_INTDIR=\"Debug\""
            ObjectFile="Debug\"
            /Zm<n> max memory alloc (% of default)
*/
            tmp = cbC2U(tool->Attribute("AdditionalOptions"));
            //tmp = ReplaceMSVCMacros(tmp);
            arr = GetArrayFromString(tmp, _T(" "));
            for (i=0; i<arr.GetCount(); ++i)
            {
                if (arr[i].IsSameAs(_T("/D")) || arr[i].IsSameAs(_T("-D")))
                {
                    bt->AddCompilerOption((m_ConvertSwitches? _T("-D"):_T("/D")) + arr[i+1]);
                    ++i;
                }
                else if (arr[i].StartsWith(_T("/D")) || arr[i].StartsWith(_T("-D")))
                    bt->AddCompilerOption((m_ConvertSwitches? _T("-D"):_T("/D")) + arr[i].Mid(2));
                else if (arr[i].IsSameAs(_T("/Zi")))
                    bt->AddCompilerOption(m_ConvertSwitches? _T("-g"):_T("/Zi"));
                else if (!m_ConvertSwitches)
                    bt->AddCompilerOption(arr[i]);
            }

            tmp = cbC2U(tool->Attribute("ForcedIncludeFiles"));
            if (!tmp.IsEmpty())
            {
                wxArrayString FIfiles;
                ParseInputString(tmp, FIfiles);
                for (size_t j = 0; j < FIfiles.GetCount(); ++j)
                    bt->AddCompilerOption(m_ConvertSwitches? _T("-include ") + ReplaceMSVCMacros(FIfiles[j])
                                          : _T("/FI ") + ReplaceMSVCMacros(FIfiles[j]));
            }

        }
        else if (strcmp(tool->Attribute("Name"), "VCPreBuildEventTool") == 0)
        {
            // pre-build step
            wxString cmd = ReplaceMSVCMacros(cbC2U(tool->Attribute("CommandLine")));
            if (!cmd.IsEmpty())
                bt->AddCommandsBeforeBuild(cmd);
        }
        else if (strcmp(tool->Attribute("Name"), "VCPostBuildEventTool") == 0)
        {
            // post-build step
            wxString cmd = ReplaceMSVCMacros(cbC2U(tool->Attribute("CommandLine")));
            if (!cmd.IsEmpty())
                bt->AddCommandsAfterBuild(cmd);
        }
    }
    return true;
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:101,代码来源:msvc7loader.cpp

示例2: if


//.........这里部分代码省略.........

                    const TiXmlElement* cinc = res->FirstChildElement("AdditionalIncludeDirectories");
                    wxArrayString cdirs = GetArrayPaths(cinc,m_pc[sName]);
                    for (size_t j=0; j<cdirs.Count(); ++j)
                        bt->AddResourceIncludeDir(cdirs.Item(j));

                    const TiXmlElement* copt = res->FirstChildElement("AdditionalOptions");
                    wxArrayString copts = GetArray(copt,_T(" "));
                    if (!m_ConvertSwitches)
                    {
                        for (size_t j=0; j<copts.Count(); ++j)
                            bt->AddCompilerOption(copts.Item(j));
                    }
                }

                const TiXmlElement* link = idef->FirstChildElement("Link");
                if (link)
                {
                    const TiXmlElement* copt;
                    if ((copt=link->FirstChildElement("OutputFile")))
                    {
                        wxString val = GetText(copt);
                        ReplaceConfigMacros(m_pc[sName],val);
                        if (!val.IsEmpty())
                            bt->SetOutputFilename(val);
                    }
                    if ((copt=link->FirstChildElement("ModuleDefinitionFile")))
                    {
                        wxString val = GetText(copt);
                        ReplaceConfigMacros(m_pc[sName],val);
                        if (!val.IsEmpty())
                            bt->SetDefinitionFileFilename(val);
                    }
                    if ((copt=link->FirstChildElement("ImportLibrary")))
                    {
                        wxString val=GetText(copt);
                        ReplaceConfigMacros(m_pc[sName],val);
                        if (!val.IsEmpty())
                            bt->SetImportLibraryFilename(val);
                    }

                    copt = link->FirstChildElement("AdditionalDependencies");
                    wxArrayString libs = GetLibs(copt);
                    for (size_t j=0; j<libs.Count(); ++j)
                        bt->AddLinkLib(libs.Item(j));

                    copt = link->FirstChildElement("AdditionalLibraryDirectories"); /// @note : maybe use loops on all elements
                    for (; copt; copt=copt->NextSiblingElement("AdditionalLibraryDirectories"))
                    {
                        wxArrayString ldirs = GetArrayPaths(copt,m_pc[sName]);
                        for (size_t j=0; j<ldirs.Count(); ++j)
                            bt->AddLibDir(ldirs.Item(j));
                    }

                    if (!m_ConvertSwitches)
                    {
                        copt = link->FirstChildElement("AdditionalOptions");
                        wxArrayString lopts = GetArray(copt,_T(" "));
                        for (size_t j=0; j<lopts.Count(); ++j)
                            bt->AddLinkerOption(lopts.Item(j));

                        copt = link->FirstChildElement("GenerateDebugInformation");
                        wxString sDebug = GetText(copt);
                        if (sDebug.IsSameAs(_T("true"),false))
                            bt->AddLinkerOption(_T("/debug"));
                    }
                }

                const TiXmlElement* event;
                if ((event=idef->FirstChildElement("PreBuildEvent")))
                {
                    const TiXmlElement* copt=event->FirstChildElement("Command");
                    for (; copt; copt=copt->NextSiblingElement("Command"))
                    {
                        wxString cmd = UnixFilename(GetText(copt));
                        ReplaceConfigMacros(m_pc[sName],cmd);
                        if (!cmd.IsEmpty()) bt->AddCommandsBeforeBuild(cmd);
                    }
                }
                if ((event=idef->FirstChildElement("PostBuildEvent")))
                {
                    const TiXmlElement* copt = event->FirstChildElement("Command");
                    for (; copt; copt=copt->NextSiblingElement("Command"))
                    {
                        wxString cmd=UnixFilename(GetText(copt));
                        ReplaceConfigMacros(m_pc[sName],cmd);
                        if (!cmd.IsEmpty()) bt->AddCommandsAfterBuild(cmd);
                    }
                }

                bResult = true; // got something
            }
        }
    }

    if (!bResult)
        pMsg->DebugLog(_("Failed to find any includes in the project...?!"));

    return bResult;
}
开发者ID:stahta01,项目名称:codeblocks_sf,代码行数:101,代码来源:msvc10loader.cpp


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