本文整理汇总了C++中CompilerPtr::SetCompilerFamily方法的典型用法代码示例。如果您正苦于以下问题:C++ CompilerPtr::SetCompilerFamily方法的具体用法?C++ CompilerPtr::SetCompilerFamily怎么用?C++ CompilerPtr::SetCompilerFamily使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompilerPtr
的用法示例。
在下文中一共展示了CompilerPtr::SetCompilerFamily方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddTools
void CompilerLocatorGCC::AddTools(CompilerPtr compiler,
const wxString& binFolder,
const wxString& suffix)
{
wxFileName masterPath(binFolder, "");
wxString defaultBinFolder = "/usr/bin";
compiler->SetCompilerFamily(COMPILER_FAMILY_GCC);
compiler->SetInstallationPath( binFolder );
CL_DEBUG("Found GNU GCC compiler under: %s. \"%s\"", masterPath.GetPath(), compiler->GetName());
wxFileName toolFile(binFolder, "");
// ++++-----------------------------------------------------------------
// With XCode installation, only
// g++, gcc, and make are installed under the Xcode installation folder
// the rest (mainly ar and as) are taken from /usr/bin
// ++++-----------------------------------------------------------------
toolFile.SetFullName("g++");
AddTool(compiler, "CXX", toolFile.GetFullPath(), suffix);
AddTool(compiler, "LinkerName", toolFile.GetFullPath(), suffix);
#ifndef __WXMAC__
AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), suffix, "-shared -fPIC");
#else
AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), suffix, "-dynamiclib -fPIC");
#endif
toolFile.SetFullName("gcc");
AddTool(compiler, "CC", toolFile.GetFullPath(), suffix);
toolFile.SetFullName("make");
wxString makeExtraArgs;
if ( wxThread::GetCPUCount() > 1 ) {
makeExtraArgs << "-j" << wxThread::GetCPUCount();
}
AddTool(compiler, "MAKE", toolFile.GetFullPath(), "", makeExtraArgs);
// ++++-----------------------------------------------------------------
// From this point on, we use /usr/bin only
// ++++-----------------------------------------------------------------
toolFile.AssignDir( defaultBinFolder );
toolFile.SetFullName("ar");
AddTool(compiler, "AR", toolFile.GetFullPath(), "", "rcu");
toolFile.SetFullName("windres");
AddTool(compiler, "ResourceCompiler", "", "");
toolFile.SetFullName("as");
AddTool(compiler, "AS", toolFile.GetFullPath(), "");
}