void CompilersFoundDlg::MSWUpdateToolchain(CompilerPtr compiler) { wxUnusedVar(compiler); #ifdef __WXMSW__ if(compiler->GetCompilerFamily() == COMPILER_FAMILY_MINGW) { // Clang and VC lacks 2 tools: make and windres // so we copy those from the default MinGW compiler wxString make = compiler->GetTool("MAKE"); wxString resourceCompiler = compiler->GetTool("ResourceCompiler"); for(size_t i = 0; i < m_allCompilers.size(); ++i) { CompilerPtr c = m_allCompilers.at(i); if(c->GetCompilerFamily() == COMPILER_FAMILY_CLANG || c->GetCompilerFamily() == COMPILER_FAMILY_VC) { c->SetTool("MAKE", make); c->SetTool("ResourceCompiler", resourceCompiler); if(c->GetCompilerFamily() == COMPILER_FAMILY_CLANG) { // Clang under Windows, needs the include paths from the MinGW compiler IncludePathLocator locator(NULL); wxArrayString includePaths, excludePaths; locator.Locate(includePaths, excludePaths, false, compiler->GetTool("CXX")); // Convert the include paths to semi colon separated list wxString mingwIncludePaths = wxJoin(includePaths, ';'); c->SetGlobalIncludePath(mingwIncludePaths); } } } } #endif }
void CompilerLocatorMinGW::AddTool(CompilerPtr compiler, const wxString& toolname, const wxString& toolpath, const wxString& extraArgs) { wxString tool = toolpath; ::WrapWithQuotes(tool); if(!extraArgs.IsEmpty()) { tool << " " << extraArgs; } compiler->SetTool(toolname, tool); }
void CompilerLocatorCrossGCC::AddTool(CompilerPtr compiler, const wxString& toolname, const wxString& toolpath, const wxString& extraArgs) { wxString tool = toolpath; ::WrapWithQuotes(tool); compiler->SetTool(toolname, tool + " " + extraArgs); CL_DEBUG("Adding tool: %s => %s", toolname, tool); }
void CompilersDetectorManager::MSWFixClangToolChain(CompilerPtr compiler, const ICompilerLocator::CompilerVec_t& allCompilers) { // Update the toolchain (if Windows) #ifdef __WXMSW__ ICompilerLocator::CompilerVec_t compilers; if(allCompilers.empty()) { BuildSettingsConfigCookie cookie; CompilerPtr cmp = BuildSettingsConfigST::Get()->GetFirstCompiler(cookie); while(cmp) { compilers.push_back(cmp); cmp = BuildSettingsConfigST::Get()->GetNextCompiler(cookie); } } else { compilers.insert(compilers.end(), allCompilers.begin(), allCompilers.end()); } if(compiler->GetCompilerFamily() == COMPILER_FAMILY_CLANG) { for(size_t i = 0; i < compilers.size(); ++i) { CompilerPtr mingwCmp = compilers.at(i); if(mingwCmp->GetCompilerFamily() == COMPILER_FAMILY_MINGW) { compiler->SetTool("MAKE", mingwCmp->GetTool("MAKE")); compiler->SetTool("ResourceCompiler", mingwCmp->GetTool("ResourceCompiler")); // Update the include paths IncludePathLocator locator(NULL); wxArrayString includePaths, excludePaths; locator.Locate(includePaths, excludePaths, false, mingwCmp->GetTool("CXX")); // Convert the include paths to semi colon separated list wxString mingwIncludePaths = wxJoin(includePaths, ';'); compiler->SetGlobalIncludePath(mingwIncludePaths); // Keep the mingw's bin path wxFileName mingwGCC(mingwCmp->GetTool("CXX")); compiler->SetPathVariable(mingwGCC.GetPath()); break; } } } #endif }
void CompilerLocatorCygwin::AddTool(CompilerPtr compiler, const wxString& toolname, const wxString& toolpath, const wxString& extraArgs) { wxString tool = toolpath; ::WrapWithQuotes(tool); // Cygwin does not like backslahes... replace the tools to use / tool.Replace("\\", "/"); if(!extraArgs.IsEmpty()) { tool << " " << extraArgs; } compiler->SetTool(toolname, tool); }
void CompilerLocatorGCC::AddTool(CompilerPtr compiler, const wxString& toolname, const wxString& toolpath, const wxString& suffix, const wxString& extraArgs) { wxString tool = toolpath; if ( !suffix.IsEmpty() ) { tool << "-" << suffix; } ::WrapWithQuotes(tool); tool << " " << extraArgs; compiler->SetTool(toolname, tool); CL_DEBUG("Adding tool: %s => %s", toolname, tool); }
void CompilerLocatorCrossGCC::AddTool(CompilerPtr compiler, const wxString& toolname, const wxString& toolpath, const wxString& extraArgs) { wxString tool = toolpath; ::WrapWithQuotes(tool); if(!extraArgs.IsEmpty()) { tool << " " << extraArgs; } compiler->SetTool(toolname, tool); CL_DEBUG("Adding tool: %s => %s", toolname, tool); }
void CompilerLocatorMinGW::AddTool(CompilerPtr compiler, const wxString& toolname, const wxString& toolpath, const wxString& extraArgs) { wxString tool = toolpath; ::WrapWithQuotes(tool); compiler->SetTool(toolname, toolpath + " " + extraArgs); }