Code::Blocks  SVN r11506
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Static Private Attributes | Friends | List of all members
Compiler Class Referenceabstract

Abstract base class for compilers. More...

#include <compiler.h>

Inheritance diagram for Compiler:
Collaboration diagram for Compiler:

Classes

struct  MirrorSettings
 

Public Member Functions

 Compiler (const wxString &name, const wxString &ID, const wxString &parentID=wxEmptyString, int weight=50)
 
 ~Compiler () override
 
virtual bool IsValid ()
 Check if the compiler is actually valid (installed). More...
 
virtual CompilerLineType CheckForWarningsAndErrors (const wxString &line)
 Check if the supplied string is a compiler warning/error. More...
 
virtual wxString GetLastErrorFilename ()
 Returns warning/error filename. More...
 
virtual wxString GetLastErrorLine ()
 Returns warning/error line number (as a string). More...
 
virtual wxString GetLastError ()
 Returns warning/error actual string. More...
 
virtual const wxStringGetName () const
 Get the compiler's name. More...
 
virtual const wxStringGetMasterPath () const
 Get the compiler's master path (must contain "bin", "include" and "lib") More...
 
virtual const wxArrayStringGetExtraPaths () const
 Get the compiler's extra paths. More...
 
virtual const CompilerProgramsGetPrograms () const
 Get the compiler's programs. More...
 
virtual const CompilerSwitchesGetSwitches () const
 Get the compiler's generic switches. More...
 
virtual const CompilerOptionsGetOptions () const
 Get the compiler's options. More...
 
virtual const wxStringGetCommand (CommandType ct, const wxString &fileExtension=wxEmptyString) const
 Get a command based on CommandType. More...
 
virtual const CompilerToolGetCompilerTool (CommandType ct, const wxString &fileExtension=wxEmptyString) const
 Get a compiler tool based on CommandType. More...
 
virtual CompilerToolsVectorGetCommandToolsVector (CommandType ct)
 Get a command tool vector based on CommandType (used by advanced compiler dialog) More...
 
virtual const RegExArrayGetRegExArray ()
 Get the array of regexes used in errors/warnings recognition. More...
 
virtual void LoadDefaultRegExArray (bool globalPrecedence=false)
 Load the default (preset) array of regexes used in errors/warnings recognition. More...
 
virtual void SetName (const wxString &name)
 Set the compiler's name. More...
 
virtual void SetMasterPath (const wxString &path)
 Set the compiler's master path (must contain "bin", "include" and "lib") More...
 
virtual void SetExtraPaths (const wxArrayString &paths)
 Set the compiler's extra paths. More...
 
virtual void SetPrograms (const CompilerPrograms &programs)
 Set the compiler's programs. More...
 
virtual void SetSwitches (const CompilerSwitches &switches)
 Set the compiler's generic switches. More...
 
virtual void SetOptions (const CompilerOptions &options)
 Set the compiler's options. More...
 
virtual void SetRegExArray (const RegExArray &regexes)
 Set the array of regexes used in errors/warnings recognition. More...
 
virtual void SaveSettings (const wxString &baseKey)
 Save settings. More...
 
virtual void LoadSettings (const wxString &baseKey)
 Load settings. More...
 
virtual void Reset ()
 Reset settings to defaults. More...
 
virtual void ReloadOptions ()
 Reload option flags (for copied compilers). More...
 
virtual AutoDetectResult AutoDetectInstallationDir ()=0
 Try to auto-detect the compiler's installation directory. More...
 
const wxStringGetID () const
 Get this compiler's unique ID. More...
 
const wxStringGetParentID () const
 Get this compiler's parent's unique ID. More...
 
virtual void SetVersionString ()
 Set the compiler version string. More...
 
const wxString GetVersionString () const
 Get the compiler version string. More...
 
virtual CompilerCommandGeneratorGetCommandGenerator (cbProject *project)
 This is to be overridden, if compiler needs to alter the default command line generation. More...
 
void SetCOnlyFlags (const wxString &flags)
 
void SetCPPOnlyFlags (const wxString &flags)
 
const wxStringGetCOnlyFlags ()
 
const wxStringGetCPPOnlyFlags ()
 
bool WithMultiLineMsg ()
 Do compiler writes multi-line messages? More...
 
wxString MakeInvalidCompilerMessages () const
 Returns messages which might be useful to the use for debugging why the compiler is invalid. More...
 
- Public Member Functions inherited from CompileOptionsBase
 CompileOptionsBase ()
 
virtual ~CompileOptionsBase ()
 
virtual void AddPlatform (int platform)
 
virtual void RemovePlatform (int platform)
 
virtual void SetPlatforms (int platforms)
 
virtual int GetPlatforms () const
 
virtual bool SupportsCurrentPlatform () const
 
virtual void SetLinkerOptions (const wxArrayString &linkerOpts)
 
virtual const wxArrayStringGetLinkerOptions () const
 
virtual void AddLinkerOption (const wxString &option)
 
virtual void ReplaceLinkerOption (const wxString &option, const wxString &new_option)
 
virtual void RemoveLinkerOption (const wxString &option)
 
virtual void SetLinkLibs (const wxArrayString &linkLibs)
 
virtual const wxArrayStringGetLinkLibs () const
 
virtual void AddLinkLib (const wxString &option)
 
virtual void ReplaceLinkLib (const wxString &option, const wxString &new_option)
 
virtual void RemoveLinkLib (const wxString &option)
 
virtual void SetCompilerOptions (const wxArrayString &compilerOpts)
 
virtual const wxArrayStringGetCompilerOptions () const
 
virtual void AddCompilerOption (const wxString &option)
 
virtual void ReplaceCompilerOption (const wxString &option, const wxString &new_option)
 
virtual void RemoveCompilerOption (const wxString &option)
 
virtual void SetResourceCompilerOptions (const wxArrayString &resourceCompilerOpts)
 
virtual const wxArrayStringGetResourceCompilerOptions () const
 
virtual void AddResourceCompilerOption (const wxString &option)
 
virtual void ReplaceResourceCompilerOption (const wxString &option, const wxString &new_option)
 
virtual void RemoveResourceCompilerOption (const wxString &option)
 
virtual void SetIncludeDirs (const wxArrayString &includeDirs)
 
virtual const wxArrayStringGetIncludeDirs () const
 
virtual void AddIncludeDir (const wxString &option)
 
virtual void ReplaceIncludeDir (const wxString &option, const wxString &new_option)
 
virtual void RemoveIncludeDir (const wxString &option)
 
virtual void SetResourceIncludeDirs (const wxArrayString &resIncludeDirs)
 
virtual const wxArrayStringGetResourceIncludeDirs () const
 
virtual void AddResourceIncludeDir (const wxString &option)
 
virtual void ReplaceResourceIncludeDir (const wxString &option, const wxString &new_option)
 
virtual void RemoveResourceIncludeDir (const wxString &option)
 
virtual void SetLibDirs (const wxArrayString &libDirs)
 
virtual const wxArrayStringGetLibDirs () const
 
virtual void AddLibDir (const wxString &option)
 
virtual void ReplaceLibDir (const wxString &option, const wxString &new_option)
 
virtual void RemoveLibDir (const wxString &option)
 
virtual void SetCommandsBeforeBuild (const wxArrayString &commands)
 
virtual const wxArrayStringGetCommandsBeforeBuild () const
 
virtual void AddCommandsBeforeBuild (const wxString &command)
 
virtual void RemoveCommandsBeforeBuild (const wxString &command)
 
virtual void SetCommandsAfterBuild (const wxArrayString &commands)
 
virtual const wxArrayStringGetCommandsAfterBuild () const
 
virtual void AddCommandsAfterBuild (const wxString &command)
 
virtual void RemoveCommandsAfterBuild (const wxString &command)
 
virtual void SetBuildScripts (const wxArrayString &scripts)
 
virtual const wxArrayStringGetBuildScripts () const
 
virtual void AddBuildScript (const wxString &script)
 
virtual void RemoveBuildScript (const wxString &script)
 
virtual bool GetModified () const
 
virtual void SetModified (bool modified)
 
virtual bool GetAlwaysRunPostBuildSteps () const
 
virtual void SetAlwaysRunPostBuildSteps (bool always)
 
virtual bool SetVar (const wxString &key, const wxString &value, bool onlyIfExists=false)
 
virtual bool UnsetVar (const wxString &key)
 
virtual void UnsetAllVars ()
 
virtual bool HasVar (const wxString &key) const
 
virtual const wxStringGetVar (const wxString &key) const
 
virtual const StringHash & GetAllVars () const
 

Static Public Attributes

static const wxString FilePathWithSpaces = _T("[][{}() \t#%$~[:alnum:]&_:+/\\.-]+")
 
static wxString CommandTypeDescriptions [ctCount]
 Get the command type descriptions (used in advanced compiler options) More...
 

Protected Member Functions

 Compiler (const Compiler &other)
 
virtual CompilerCreateCopy ()=0
 Implement this in new compilers, to return a new copy. More...
 
bool IsUniqueID (const wxString &ID)
 
void MakeValidID ()
 
void LoadDefaultOptions (const wxString &name, int recursion=0)
 
void LoadRegExArray (const wxString &name, bool globalPrecedence=false, int recursion=0)
 
bool EvalXMLCondition (const wxXmlNode *node)
 
wxString GetExecName (const wxString &name)
 
void MirrorCurrentSettings ()
 

Protected Attributes

wxString m_Name
 
wxString m_MasterPath
 
wxArrayString m_ExtraPaths
 
CompilerToolsVector m_Commands [ctCount]
 
CompilerPrograms m_Programs
 
CompilerSwitches m_Switches
 
CompilerOptions m_Options
 
RegExArray m_RegExes
 
wxString m_ErrorFilename
 
wxString m_ErrorLine
 
wxString m_Error
 
wxString m_VersionString
 
wxString m_SortOptions [2]
 
int m_Weight
 
bool m_MultiLineMessages
 
- Protected Attributes inherited from CompileOptionsBase
int m_Platform
 
wxArrayString m_LinkerOptions
 
wxArrayString m_LinkLibs
 
wxArrayString m_CompilerOptions
 
wxArrayString m_ResourceCompilerOptions
 
wxArrayString m_IncludeDirs
 
wxArrayString m_ResIncludeDirs
 
wxArrayString m_LibDirs
 
wxArrayString m_CmdsBefore
 
wxArrayString m_CmdsAfter
 
wxArrayString m_Scripts
 
bool m_Modified
 
bool m_AlwaysRunPostCmds
 
StringHash m_Vars
 

Private Attributes

wxString m_ID
 
wxString m_ParentID
 
bool m_Valid
 
bool m_NeedValidityCheck
 
MirrorSettings m_Mirror
 
bool m_Mirrored
 

Static Private Attributes

static wxArrayString m_CompilerIDs
 

Friends

class CompilerFactory
 

Detailed Description

Abstract base class for compilers.

Create a derived class and add it in compilerfactory.cpp

Definition at line 274 of file compiler.h.


Class Documentation

◆ Compiler::MirrorSettings

struct Compiler::MirrorSettings

Definition at line 432 of file compiler.h.

Collaboration diagram for Compiler::MirrorSettings:
Class Members
wxArrayString CmdsAfter
wxArrayString CmdsBefore
CompilerToolsVector Commands[ctCount]
wxArrayString CompilerOptions_
wxArrayString ExtraPaths
wxArrayString IncludeDirs
wxArrayString LibDirs
wxArrayString LinkerOptions
wxArrayString LinkLibs
wxString MasterPath
wxString Name
CompilerOptions Options
CompilerPrograms Programs
RegExArray RegExes
wxArrayString ResIncludeDirs
wxArrayString ResourceCompilerOptions
wxString SortOptions[2]
CompilerSwitches Switches

Constructor & Destructor Documentation

◆ Compiler() [1/2]

Compiler::Compiler ( const wxString name,
const wxString ID,
const wxString parentID = wxEmptyString,
int  weight = 50 
)

◆ ~Compiler()

Compiler::~Compiler ( )
override

Definition at line 152 of file compiler.cpp.

◆ Compiler() [2/2]

Compiler::Compiler ( const Compiler other)
protected

Member Function Documentation

◆ AutoDetectInstallationDir()

virtual AutoDetectResult Compiler::AutoDetectInstallationDir ( )
pure virtual

◆ CheckForWarningsAndErrors()

CompilerLineType Compiler::CheckForWarningsAndErrors ( const wxString line)
virtual

◆ CreateCopy()

virtual Compiler* Compiler::CreateCopy ( )
protectedpure virtual

◆ EvalXMLCondition()

bool Compiler::EvalXMLCondition ( const wxXmlNode node)
protected

◆ GetCommand()

const wxString & Compiler::GetCommand ( CommandType  ct,
const wxString fileExtension = wxEmptyString 
) const
virtual

Get a command based on CommandType.

Parameters
ctThe command type to process
fileExtensionthe file's extension (no leading dot)

Definition at line 305 of file compiler.cpp.

References wxString::IsEmpty(), and m_Commands.

Referenced by DirectCommands::GetCompileSingleFileCommand(), DirectCommands::GetTargetLinkCommands(), and ProjectFileOptionsDlg::UpdateBuildCommand().

◆ GetCommandGenerator()

CompilerCommandGenerator * Compiler::GetCommandGenerator ( cbProject project)
virtual

This is to be overridden, if compiler needs to alter the default command line generation.

Reimplemented in CompilerMINGW, and CompilerOW.

Definition at line 298 of file compiler.cpp.

References CompilerCommandGenerator::Init().

Referenced by NativeParser::AddCompilerDirs(), cbGetDynamicLinkerPathForTarget(), and DirectCommands::DirectCommands().

◆ GetCommandToolsVector()

virtual CompilerToolsVector& Compiler::GetCommandToolsVector ( CommandType  ct)
inlinevirtual

Get a command tool vector based on CommandType (used by advanced compiler dialog)

Definition at line 312 of file compiler.h.

Referenced by CompilerOptionsDlg::DoSaveCompilerDefinition(), AdvancedCompilerOptionsDlg::ReadCompilerOptions(), and AdvancedCompilerOptionsDlg::WriteCompilerOptions().

◆ GetCompilerTool()

const CompilerTool * Compiler::GetCompilerTool ( CommandType  ct,
const wxString fileExtension = wxEmptyString 
) const
virtual

Get a compiler tool based on CommandType.

Definition at line 334 of file compiler.cpp.

References wxString::IsEmpty(), and m_Commands.

Referenced by cbProject::AddFile(), and DirectCommands::GetCompileFileCommand().

◆ GetCOnlyFlags()

const wxString& Compiler::GetCOnlyFlags ( )
inline

◆ GetCPPOnlyFlags()

const wxString& Compiler::GetCPPOnlyFlags ( )
inline

◆ GetExecName()

wxString Compiler::GetExecName ( const wxString name)
protected

◆ GetExtraPaths()

virtual const wxArrayString& Compiler::GetExtraPaths ( ) const
inlinevirtual

◆ GetID()

const wxString& Compiler::GetID ( ) const
inline

◆ GetLastError()

virtual wxString Compiler::GetLastError ( )
inlinevirtual

Returns warning/error actual string.

Use it after a call to CheckForWarningsAndErrors()

Definition at line 291 of file compiler.h.

Referenced by CompilerGCC::AddOutputLine(), and AdvancedCompilerOptionsDlg::OnRegexTest().

◆ GetLastErrorFilename()

virtual wxString Compiler::GetLastErrorFilename ( )
inlinevirtual

Returns warning/error filename.

Use it after a call to CheckForWarningsAndErrors()

Definition at line 287 of file compiler.h.

Referenced by CompilerGCC::AddOutputLine(), and AdvancedCompilerOptionsDlg::OnRegexTest().

◆ GetLastErrorLine()

virtual wxString Compiler::GetLastErrorLine ( )
inlinevirtual

Returns warning/error line number (as a string).

Use it after a call to CheckForWarningsAndErrors()

Definition at line 289 of file compiler.h.

Referenced by CompilerGCC::AddOutputLine(), and AdvancedCompilerOptionsDlg::OnRegexTest().

◆ GetMasterPath()

virtual const wxString& Compiler::GetMasterPath ( ) const
inlinevirtual

◆ GetName()

virtual const wxString& Compiler::GetName ( ) const
inlinevirtual

◆ GetOptions()

virtual const CompilerOptions& Compiler::GetOptions ( ) const
inlinevirtual

◆ GetParentID()

const wxString& Compiler::GetParentID ( ) const
inline

◆ GetPrograms()

virtual const CompilerPrograms& Compiler::GetPrograms ( ) const
inlinevirtual

◆ GetRegExArray()

virtual const RegExArray& Compiler::GetRegExArray ( )
inlinevirtual

Get the array of regexes used in errors/warnings recognition.

Definition at line 314 of file compiler.h.

Referenced by CompilerOptionsDlg::DoSaveCompilerDefinition(), AdvancedCompilerOptionsDlg::OnRegexDefaults(), and AdvancedCompilerOptionsDlg::ReadCompilerOptions().

◆ GetSwitches()

virtual const CompilerSwitches& Compiler::GetSwitches ( ) const
inlinevirtual

Get the compiler's generic switches.

Definition at line 301 of file compiler.h.

Referenced by DirectCommands::AreExternalDepsOutdated(), CompilerGCC::BuildStateManagement(), ProjectLoader::ConvertLibraries(), CompilerGCC::DoCleanWithMake(), CompilerOptionsDlg::DoLoadOptions(), CompilerOptionsDlg::DoSaveCompilerDefinition(), CompilerOptionsDlg::DoSaveOptions(), ProjectLoader::ExportTargetAsProject(), CompilerCommandGenerator::FixPathSeparators(), CompilerCommandGenerator::FixupLinkLibraries(), CompilerCommandGenerator::GenerateCommandLine(), CompileTargetBase::GenerateTargetFilename(), DirectCommands::GetCleanSingleFileCommand(), DirectCommands::GetCompileFileCommand(), DirectCommands::GetCompileSingleFileCommand(), CompilerCommandGenerator::GetOrderedIncludeDirs(), CompilerCommandGenerator::GetOrderedLibrariesDirs(), CompilerCommandGenerator::GetOrderedResourceIncludeDirs(), CompilerCommandGenerator::GetProcessedIncludeDir(), CompileTargetBase::GetStaticLibFilename(), DirectCommands::GetTargetCleanCommands(), DirectCommands::GetTargetLinkCommands(), DirectCommands::IsObjectOutdated(), TemplateManager::NewProjectFromUserTemplate(), CompilerGCC::OnCleanFile(), ProjectOptionsDlg::OnProjectTypeChanged(), CompilerOptionsDlg::OptionsToText(), ProjectOptionsDlg::ProjectOptionsDlg(), AdvancedCompilerOptionsDlg::ReadCompilerOptions(), CompilerCommandGenerator::SearchDirsFromBackticks(), cbProject::SetCompilerID(), ProjectFile::SetObjName(), CompilerMINGWGenerator::SetupIncludeDirs(), CompilerCommandGenerator::SetupIncludeDirs(), CompilerOWGenerator::SetupLibrariesDirs(), CompilerCommandGenerator::SetupLibrariesDirs(), CompilerCommandGenerator::SetupLinkLibraries(), CompilerCommandGenerator::SetupOutputFilenames(), CompilerCommandGenerator::SetupResourceIncludeDirs(), CompilerOptionsDlg::TextToOptions(), and pfDetails::Update().

◆ GetVersionString()

const wxString Compiler::GetVersionString ( ) const
inline

Get the compiler version string.

Definition at line 365 of file compiler.h.

Referenced by CompilerMINGWGenerator::SetupIncludeDirs().

◆ IsUniqueID()

bool Compiler::IsUniqueID ( const wxString ID)
inlineprotected

Definition at line 392 of file compiler.h.

References wxNOT_FOUND.

Referenced by MakeValidID().

◆ IsValid()

bool Compiler::IsValid ( )
virtual

◆ LoadDefaultOptions()

void Compiler::LoadDefaultOptions ( const wxString name,
int  recursion = 0 
)
protected

Definition at line 809 of file compiler.cpp.

References _(), CompilerOptions::AddOption(), CompilerPrograms::C, wxString::c_str(), cbMessageBox(), clogFull, clogNone, clogSimple, CompilerPrograms::CPP, ctCompileObjectCmd, ctCompileResourceCmd, ctCount, ctGenDependenciesCmd, ctLinkConsoleExeCmd, ctLinkDynamicCmd, ctLinkExeCmd, ctLinkNativeCmd, ctLinkStaticCmd, CompilerPrograms::DBGconfig, CompilerSwitches::defaultLogging, CompilerSwitches::defines, EvalXMLCondition(), ConfigManager::Exists(), CompilerSwitches::forceCompilerUseQuotes, CompilerSwitches::forceFwdSlashes, CompilerSwitches::forceLinkerUseQuotes, CompilerSwitches::genericSwitch, Manager::Get(), wxXmlNode::GetAttribute(), wxXmlNode::GetChildren(), CompilerFactory::GetCompilerIndex(), Manager::GetConfigManager(), GetCOnlyFlags(), GetCPPOnlyFlags(), Manager::GetLogManager(), wxXmlNode::GetName(), wxXmlNode::GetNext(), wxXmlNode::GetParent(), GetParentID(), wxXmlDocument::GetRoot(), CompilerSwitches::includeDirs, CompilerSwitches::includeDirSeparator, wxString::IsEmpty(), CompilerPrograms::LD, CompilerPrograms::LIB, CompilerSwitches::libDirs, CompilerSwitches::libDirSeparator, CompilerSwitches::libExtension, CompilerSwitches::libPrefix, CompilerSwitches::linkerNeedsLibExtension, CompilerSwitches::linkerNeedsLibPrefix, CompilerSwitches::linkerNeedsPathResolved, CompilerSwitches::linkLibs, wxXmlDocument::Load(), ConfigManager::LocateDataFile(), LogManager::Log(), CompilerSwitches::logging, LogManager::LogWarning(), m_Commands, m_ID, m_Mirror, m_Options, m_Programs, m_Switches, CompilerPrograms::MAKE, MakeUniqueString(), CompilerSwitches::needDependencies, CompilerSwitches::objectExtension, CompilerSwitches::objectSeparator, CompilerSwitches::PCHExtension, wxString::Printf(), Compiler::MirrorSettings::Programs, ConfigManager::Read(), wxString::Replace(), sdDataGlobal, sdDataUser, SetCOnlyFlags(), SetCPPOnlyFlags(), CompilerSwitches::statusSuccess, CompilerSwitches::supportsPCH, wxString::ToLong(), CompilerSwitches::Use83Paths, CompilerSwitches::UseFlatObjects, CompilerSwitches::UseFullSourcePaths, CompilerPrograms::WINDRES, wxEmptyString, wxGetTranslation(), wxICON_ERROR, wxICON_EXCLAMATION, and wxT.

Referenced by ReloadOptions(), CompilerLCC::Reset(), and Reset().

◆ LoadDefaultRegExArray()

void Compiler::LoadDefaultRegExArray ( bool  globalPrecedence = false)
virtual

Load the default (preset) array of regexes used in errors/warnings recognition.

Definition at line 183 of file compiler.cpp.

References GetID(), LoadRegExArray(), and m_RegExes.

Referenced by AdvancedCompilerOptionsDlg::OnRegexDefaults(), ReloadOptions(), CompilerLCC::Reset(), and Reset().

◆ LoadRegExArray()

void Compiler::LoadRegExArray ( const wxString name,
bool  globalPrecedence = false,
int  recursion = 0 
)
protected

◆ LoadSettings()

void Compiler::LoadSettings ( const wxString baseKey)
virtual

Load settings.

Reimplemented in CompilerOW.

Definition at line 584 of file compiler.cpp.

References _(), _T, CompilerPrograms::C, wxString::c_str(), cbMessageBox(), CompilerTool::command, Compiler::MirrorSettings::Commands, CommandTypeDescriptions, CompilerSettingsVersion, CompilerPrograms::CPP, ctCount, CompilerPrograms::DBGconfig, CompilerSwitches::defines, ConfigManager::EnumerateKeys(), ConfigManager::EnumerateSubPaths(), ConfigManager::Exists(), CompilerTool::extensions, CompilerSwitches::forceCompilerUseQuotes, CompilerSwitches::forceFwdSlashes, CompilerSwitches::forceLinkerUseQuotes, wxString::Format(), CompilerTool::generatedFiles, CompilerSwitches::genericSwitch, Manager::Get(), GetArrayFromString(), CompilerFactory::GetCompilerIndex(), Manager::GetConfigManager(), wxArrayString::GetCount(), wxFileName::GetPathSeparator(), CompilerSwitches::includeDirs, CompilerSwitches::includeDirSeparator, IsValid(), CompilerPrograms::LD, CompilerPrograms::LIB, CompilerSwitches::libDirs, CompilerSwitches::libDirSeparator, CompilerSwitches::libExtension, CompilerSwitches::libPrefix, CompilerSwitches::linkerNeedsLibExtension, CompilerSwitches::linkerNeedsLibPrefix, CompilerSwitches::linkerNeedsPathResolved, CompilerSwitches::linkLibs, CompilerSwitches::logging, m_Commands, m_ExtraPaths, m_ID, m_MasterPath, m_Mirror, m_Name, m_Options, m_Programs, m_RegExes, m_SortOptions, m_Switches, CompilerPrograms::MAKE, MakeUniqueArray(), MirrorCurrentSettings(), CompilerSwitches::needDependencies, CompilerSwitches::objectExtension, CompilerSwitches::objectSeparator, Compiler::MirrorSettings::Options, CompilerSwitches::PCHExtension, wxString::Printf(), ConfigManager::Read(), ConfigManager::ReadArrayString(), ConfigManager::ReadBool(), ConfigManager::ReadInt(), Compiler::MirrorSettings::RegExes, wxString::Remove(), wxString::Replace(), HTMLTags::sep, CompileOptionsBase::SetCommandsAfterBuild(), CompileOptionsBase::SetCommandsBeforeBuild(), CompileOptionsBase::SetCompilerOptions(), CompileOptionsBase::SetIncludeDirs(), CompileOptionsBase::SetLibDirs(), CompileOptionsBase::SetLinkerOptions(), CompileOptionsBase::SetLinkLibs(), CompileOptionsBase::SetResourceCompilerOptions(), CompileOptionsBase::SetResourceIncludeDirs(), CompileOptionsBase::SetVar(), SetVersionString(), wxString::StartsWith(), CompilerSwitches::statusSuccess, CompilerSwitches::supportsPCH, Compiler::MirrorSettings::Switches, wxString::ToLong(), CompileOptionsBase::UnsetAllVars(), CompilerSwitches::Use83Paths, CompilerSwitches::UseFlatObjects, CompilerSwitches::UseFullSourcePaths, CfgMgrConsts::version, CompilerPrograms::WINDRES, wxEmptyString, wxICON_INFORMATION, wxICON_QUESTION, wxID_YES, wxT, and wxYES_NO.

Referenced by CompilerFactory::CreateCompilerCopy(), and CompilerOW::LoadSettings().

◆ MakeInvalidCompilerMessages()

wxString Compiler::MakeInvalidCompilerMessages ( ) const

Returns messages which might be useful to the use for debugging why the compiler is invalid.

Call only after IsValid returns false.

Definition at line 233 of file compiler.cpp.

References _(), _T, CompilerPrograms::C, F(), Manager::Get(), wxArrayString::GetCount(), Manager::GetMacrosManager(), m_ExtraPaths, m_MasterPath, m_Programs, MacrosManager::ReplaceMacros(), CompileOptionsBase::SupportsCurrentPlatform(), and wxString::wx_str().

Referenced by CompilerGCC::PrintInvalidCompiler().

◆ MakeValidID()

void Compiler::MakeValidID ( )
protected

◆ MirrorCurrentSettings()

void Compiler::MirrorCurrentSettings ( )
protected

◆ ReloadOptions()

void Compiler::ReloadOptions ( )
virtual

Reload option flags (for copied compilers).

Override if not using standard XML loading.

Definition at line 174 of file compiler.cpp.

References CompilerOptions::ClearOptions(), GetID(), LoadDefaultOptions(), LoadDefaultRegExArray(), ConfigManager::LocateDataFile(), m_Options, sdDataGlobal, sdDataUser, and wxT.

Referenced by CompilerFactory::CreateCompilerCopy().

◆ Reset()

void Compiler::Reset ( )
virtual

◆ SaveSettings()

void Compiler::SaveSettings ( const wxString baseKey)
virtual

Save settings.

Definition at line 395 of file compiler.cpp.

References _T, CompilerPrograms::C, wxString::c_str(), Compiler::MirrorSettings::CmdsAfter, Compiler::MirrorSettings::CmdsBefore, Compiler::MirrorSettings::Commands, CommandTypeDescriptions, Compiler::MirrorSettings::CompilerOptions_, CompilerPrograms::CPP, ctCount, CompilerPrograms::DBGconfig, CompilerSwitches::defines, ConfigManager::DeleteSubPath(), RegExStruct::desc, Compiler::MirrorSettings::ExtraPaths, RegExStruct::filename, CompilerSwitches::forceCompilerUseQuotes, CompilerSwitches::forceFwdSlashes, CompilerSwitches::forceLinkerUseQuotes, wxString::Format(), CompilerSwitches::genericSwitch, Manager::Get(), CompileOptionsBase::GetAllVars(), CompilerFactory::GetCompilerIndex(), Manager::GetConfigManager(), GetCOnlyFlags(), GetCPPOnlyFlags(), RegExStruct::GetRegExString(), GetStringFromArray(), CompilerSwitches::includeDirs, Compiler::MirrorSettings::IncludeDirs, CompilerSwitches::includeDirSeparator, CompilerPrograms::LD, CompilerPrograms::LIB, CompilerSwitches::libDirs, Compiler::MirrorSettings::LibDirs, CompilerSwitches::libDirSeparator, CompilerSwitches::libExtension, CompilerSwitches::libPrefix, RegExStruct::line, CompilerSwitches::linkerNeedsLibExtension, CompilerSwitches::linkerNeedsLibPrefix, CompilerSwitches::linkerNeedsPathResolved, Compiler::MirrorSettings::LinkerOptions, CompilerSwitches::linkLibs, Compiler::MirrorSettings::LinkLibs, CompilerSwitches::logging, RegExStruct::lt, CompileOptionsBase::m_CmdsAfter, CompileOptionsBase::m_CmdsBefore, m_Commands, CompileOptionsBase::m_CompilerOptions, m_ExtraPaths, m_ID, CompileOptionsBase::m_IncludeDirs, CompileOptionsBase::m_LibDirs, CompileOptionsBase::m_LinkerOptions, CompileOptionsBase::m_LinkLibs, m_MasterPath, m_Mirror, m_Name, m_ParentID, m_Programs, m_RegExes, CompileOptionsBase::m_ResIncludeDirs, CompileOptionsBase::m_ResourceCompilerOptions, m_Switches, CompilerPrograms::MAKE, MakeUniqueArray(), Compiler::MirrorSettings::MasterPath, RegExStruct::msg, CompilerSwitches::needDependencies, CompilerSwitches::objectExtension, CompilerSwitches::objectSeparator, CompilerSwitches::PCHExtension, wxString::Printf(), Compiler::MirrorSettings::Programs, Compiler::MirrorSettings::RegExes, Compiler::MirrorSettings::ResIncludeDirs, Compiler::MirrorSettings::ResourceCompilerOptions, Compiler::MirrorSettings::SortOptions, CompilerSwitches::statusSuccess, CompilerSwitches::supportsPCH, Compiler::MirrorSettings::Switches, CompilerSwitches::Use83Paths, CompilerSwitches::UseFlatObjects, CompilerSwitches::UseFullSourcePaths, CompilerPrograms::WINDRES, and ConfigManager::Write().

◆ SetCOnlyFlags()

void Compiler::SetCOnlyFlags ( const wxString flags)
inline

Definition at line 372 of file compiler.h.

Referenced by LoadDefaultOptions(), and CompilerOptionsDlg::OnFlagsPopup().

◆ SetCPPOnlyFlags()

void Compiler::SetCPPOnlyFlags ( const wxString flags)
inline

Definition at line 373 of file compiler.h.

Referenced by LoadDefaultOptions(), and CompilerOptionsDlg::OnFlagsPopup().

◆ SetExtraPaths()

virtual void Compiler::SetExtraPaths ( const wxArrayString paths)
inlinevirtual

Set the compiler's extra paths.

Definition at line 323 of file compiler.h.

Referenced by CompilerOptionsDlg::AutoDetectCompiler(), and CompilerOptionsDlg::DoSaveCompilerPrograms().

◆ SetMasterPath()

virtual void Compiler::SetMasterPath ( const wxString path)
inlinevirtual

Set the compiler's master path (must contain "bin", "include" and "lib")

Reimplemented in CompilerOW.

Definition at line 321 of file compiler.h.

Referenced by CompilerOptionsDlg::AutoDetectCompiler(), AutoDetectCompilers::AutoDetectCompilers(), CompilerOptionsDlg::DoSaveCompilerPrograms(), and CompilerOW::SetMasterPath().

◆ SetName()

virtual void Compiler::SetName ( const wxString name)
inlinevirtual

Set the compiler's name.

Definition at line 319 of file compiler.h.

Referenced by CompilerFactory::CreateCompilerCopy(), and CompilerOptionsDlg::OnEditCompilerClick().

◆ SetOptions()

virtual void Compiler::SetOptions ( const CompilerOptions options)
inlinevirtual

Set the compiler's options.

Definition at line 329 of file compiler.h.

Referenced by CompilerOptionsDlg::DoSaveCompilerDefinition().

◆ SetPrograms()

virtual void Compiler::SetPrograms ( const CompilerPrograms programs)
inlinevirtual

Set the compiler's programs.

Definition at line 325 of file compiler.h.

Referenced by CompilerOptionsDlg::DoSaveCompilerPrograms().

◆ SetRegExArray()

virtual void Compiler::SetRegExArray ( const RegExArray regexes)
inlinevirtual

Set the array of regexes used in errors/warnings recognition.

Definition at line 331 of file compiler.h.

Referenced by AdvancedCompilerOptionsDlg::EndModal(), and AdvancedCompilerOptionsDlg::OnRegexTest().

◆ SetSwitches()

virtual void Compiler::SetSwitches ( const CompilerSwitches switches)
inlinevirtual

Set the compiler's generic switches.

Definition at line 327 of file compiler.h.

Referenced by CompilerOptionsDlg::DoSaveOptions(), and AdvancedCompilerOptionsDlg::WriteCompilerOptions().

◆ SetVersionString()

virtual void Compiler::SetVersionString ( )
inlinevirtual

Set the compiler version string.

Please override this virtual function with your own compiler-version detection code if you want to use this.

By default this function does nothing.

Reimplemented in CompilerMINGW.

Definition at line 362 of file compiler.h.

Referenced by CompilerG95::AutoDetectInstallationDir(), LoadSettings(), and Reset().

◆ WithMultiLineMsg()

bool Compiler::WithMultiLineMsg ( )
inline

Do compiler writes multi-line messages?

Definition at line 379 of file compiler.h.

Referenced by CompilerGCC::AddOutputLine().

Friends And Related Function Documentation

◆ CompilerFactory

friend class CompilerFactory
friend

Definition at line 385 of file compiler.h.

Member Data Documentation

◆ CommandTypeDescriptions

wxString Compiler::CommandTypeDescriptions
static
Initial value:
=
{
_("Compile single file to object file"),
_("Generate dependencies for file"),
_("Compile Win32 resource file"),
_("Link object files to executable"),
_("Link object files to console executable"),
_("Link object files to dynamic library"),
_("Link object files to static library"),
_("Link object files to native executable")
}

Get the command type descriptions (used in advanced compiler options)

Definition at line 356 of file compiler.h.

Referenced by CompilerSwitches::CompilerSwitches(), LoadSettings(), AdvancedCompilerOptionsDlg::ReadCompilerOptions(), and SaveSettings().

◆ FilePathWithSpaces

const wxString Compiler::FilePathWithSpaces = _T("[][{}() \t#%$~[:alnum:]&_:+/\\.-]+")
static

Definition at line 277 of file compiler.h.

◆ m_Commands

CompilerToolsVector Compiler::m_Commands[ctCount]
protected

◆ m_CompilerIDs

wxArrayString Compiler::m_CompilerIDs
staticprivate

◆ m_Error

wxString Compiler::m_Error
protected

Definition at line 418 of file compiler.h.

Referenced by CheckForWarningsAndErrors().

◆ m_ErrorFilename

wxString Compiler::m_ErrorFilename
protected

Definition at line 416 of file compiler.h.

Referenced by CheckForWarningsAndErrors().

◆ m_ErrorLine

wxString Compiler::m_ErrorLine
protected

Definition at line 417 of file compiler.h.

Referenced by CheckForWarningsAndErrors().

◆ m_ExtraPaths

wxArrayString Compiler::m_ExtraPaths
protected

◆ m_ID

wxString Compiler::m_ID
private

◆ m_MasterPath

wxString Compiler::m_MasterPath
protected

◆ m_Mirror

MirrorSettings Compiler::m_Mirror
private

Definition at line 458 of file compiler.h.

Referenced by LoadDefaultOptions(), LoadSettings(), MirrorCurrentSettings(), and SaveSettings().

◆ m_Mirrored

bool Compiler::m_Mirrored
private

Definition at line 459 of file compiler.h.

Referenced by MirrorCurrentSettings().

◆ m_MultiLineMessages

bool Compiler::m_MultiLineMessages
protected

◆ m_Name

wxString Compiler::m_Name
protected

Definition at line 408 of file compiler.h.

Referenced by Compiler(), LoadSettings(), MakeValidID(), MirrorCurrentSettings(), and SaveSettings().

◆ m_NeedValidityCheck

bool Compiler::m_NeedValidityCheck
private

Definition at line 429 of file compiler.h.

Referenced by Compiler(), and IsValid().

◆ m_Options

CompilerOptions Compiler::m_Options
protected

◆ m_ParentID

wxString Compiler::m_ParentID
private

Definition at line 426 of file compiler.h.

Referenced by EvalXMLCondition(), CompilerFactory::RemoveCompiler(), and SaveSettings().

◆ m_Programs

CompilerPrograms Compiler::m_Programs
protected

◆ m_RegExes

RegExArray Compiler::m_RegExes
protected

◆ m_SortOptions

wxString Compiler::m_SortOptions[2]
protected

Definition at line 420 of file compiler.h.

Referenced by Compiler(), LoadSettings(), and MirrorCurrentSettings().

◆ m_Switches

CompilerSwitches Compiler::m_Switches
protected

◆ m_Valid

bool Compiler::m_Valid
private

Definition at line 428 of file compiler.h.

Referenced by Compiler(), and IsValid().

◆ m_VersionString

wxString Compiler::m_VersionString
protected

Definition at line 419 of file compiler.h.

Referenced by Compiler(), and CompilerMINGW::SetVersionString().

◆ m_Weight

int Compiler::m_Weight
protected

The documentation for this class was generated from the following files: