Code::Blocks
SVN r11506
|
Represents a Code::Blocks project build target. More...
#include <projectbuildtarget.h>
Public Member Functions | |
ProjectBuildTarget (cbProject *parentProject) | |
Constructor. More... | |
~ProjectBuildTarget () override | |
Destructor. More... | |
virtual cbProject * | GetParentProject () |
virtual wxString | GetFullTitle () const |
virtual const wxString & | GetExternalDeps () const |
virtual void | SetExternalDeps (const wxString &deps) |
Set a list of all the external files this targets depends on. More... | |
virtual const wxString & | GetAdditionalOutputFiles () const |
virtual void | SetAdditionalOutputFiles (const wxString &files) |
Set a list of all additional output files this targets creates, besides its main output. More... | |
virtual bool | GetIncludeInTargetAll () const |
Deprecated, do not use at all! More... | |
virtual void | SetIncludeInTargetAll (bool buildIt) |
Deprecated, do not use at all! Set if this target should be built when the virtual target "All" is selected. More... | |
virtual bool | GetCreateDefFile () const |
Valid only for targets generating dynamic libraries (DLLs or SOs). More... | |
virtual void | SetCreateDefFile (bool createIt) |
Set if the target creates a DEF imports file. More... | |
virtual bool | GetCreateStaticLib () |
Valid only for targets generating dynamic libraries (DLLs or SOs). More... | |
virtual void | SetCreateStaticLib (bool createIt) |
Set if an import library should be created. More... | |
virtual bool | GetUseConsoleRunner () const |
Valid only for targets generating a console executable. More... | |
virtual void | SetUseConsoleRunner (bool useIt) |
Set if ConsoleRunner should be used. More... | |
void | SetTargetType (TargetType pt) override |
Set the target's type to pt . More... | |
virtual void | AddTargetDep (ProjectBuildTarget *target) |
Targets to be compiled (if necessary) before this one. More... | |
virtual BuildTargets & | GetTargetDeps () |
virtual FilesList & | GetFilesList () |
Provides an easy way to iterate all the files belonging in this target. More... | |
int | GetFilesCount () |
ProjectFile * | GetFile (int index) |
Access a file of the target. More... | |
bool | RemoveFile (ProjectFile *pf) |
Remove a file from the target. More... | |
Public Member Functions inherited from CompileTargetBase | |
CompileTargetBase () | |
~CompileTargetBase () override | |
virtual void | SetTargetFilenameGenerationPolicy (TargetFilenameGenerationPolicy prefix, TargetFilenameGenerationPolicy extension) |
A target's filename can either be auto-generated based on the running platform, or completely specified by the user. More... | |
virtual void | GetTargetFilenameGenerationPolicy (TargetFilenameGenerationPolicy &prefixOut, TargetFilenameGenerationPolicy &extensionOut) const |
virtual const wxString & | GetFilename () const |
virtual const wxString & | GetTitle () const |
Read the target's title. More... | |
virtual void | SetTitle (const wxString &title) |
Set the target's title. More... | |
virtual void | SetOutputFilename (const wxString &filename) |
Set the target's output filename. More... | |
virtual void | SetImportLibraryFilename (const wxString &filename) |
Set the target's import library filename. More... | |
virtual void | SetDefinitionFileFilename (const wxString &filename) |
Set the target's definition file filename. More... | |
virtual void | SetWorkingDir (const wxString &dirname) |
Set the target's working dir on execution (valid only for executable targets) More... | |
virtual void | SetObjectOutput (const wxString &dirname) |
Set the target's objects output dir. More... | |
virtual void | SetDepsOutput (const wxString &dirname) |
Set the target's dependencies output dir. More... | |
virtual OptionsRelation | GetOptionRelation (OptionsRelationType type) const |
Read the target's options relation for type . More... | |
virtual void | SetOptionRelation (OptionsRelationType type, OptionsRelation rel) |
Set the target's options relation for type to rel . More... | |
virtual wxString | GetWorkingDir () |
Read the target's working dir for execution (valid only for executable targets) More... | |
virtual wxString | GetObjectOutput () const |
Read the target's objects output dir. More... | |
virtual wxString | GetDepsOutput () const |
Read the target's dependencies output dir. More... | |
virtual wxString | GetOutputFilename () |
Read the target's output filename. More... | |
virtual wxString | SuggestOutputFilename () |
Suggest a filename based on the target's type. More... | |
virtual wxString | GetExecutableFilename () const |
Read the target's executable filename (produced if target type is ttExecutable) More... | |
virtual wxString | GetDynamicLibFilename () |
Read the target's dynamic library filename (produced if target type is ttDynamicLib) More... | |
virtual wxString | GetDynamicLibImportFilename () |
Read the target's dynamic library import filename (produced if target type is ttDynamicLib) More... | |
virtual wxString | GetDynamicLibDefFilename () |
Read the target's dynamic library definition file filename (produced if target type is ttDynamicLib) More... | |
virtual wxString | GetStaticLibFilename () |
Read the target's static library filename (produced if target type is ttStaticLib) More... | |
virtual wxString | GetNativeFilename () |
Read the target's native filename (produced if target type is ttNative) More... | |
virtual wxString | GetBasePath () const |
Read the target's base path, e.g. if GetFilename() returns "/usr/local/bin/xxx", base path will return "/usr/local/bin". More... | |
virtual TargetType | GetTargetType () const |
Read the target's type. More... | |
virtual const wxString & | GetExecutionParameters () const |
Read the target's execution parameters. More... | |
virtual void | SetExecutionParameters (const wxString ¶ms) |
Set the target's execution parameters to params . More... | |
virtual const wxString & | GetHostApplication () const |
Read the target's host application. More... | |
virtual void | SetHostApplication (const wxString &app) |
Set the target's host application to app . More... | |
virtual bool | GetRunHostApplicationInTerminal () const |
Get the flag if the host app should be run in terminal. More... | |
virtual void | SetRunHostApplicationInTerminal (bool in_terminal) |
virtual void | SetCompilerID (const wxString &id) |
! Set the flag if the host app should be run in terminal More... | |
virtual const wxString & | GetCompilerID () const |
Read the target's compiler. More... | |
virtual wxString | GetMakeCommandFor (MakeCommand cmd) const |
Get the "make" command used for cmd . More... | |
virtual void | SetMakeCommandFor (MakeCommand cmd, const wxString &make) |
Set the "make" command used for cmd . More... | |
virtual bool | MakeCommandsModified () const |
True if any of the "make" commands is modified. 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 wxArrayString & | GetLinkerOptions () 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 wxArrayString & | GetLinkLibs () 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 wxArrayString & | GetCompilerOptions () 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 wxArrayString & | GetResourceCompilerOptions () 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 wxArrayString & | GetIncludeDirs () 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 wxArrayString & | GetResourceIncludeDirs () 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 wxArrayString & | GetLibDirs () 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 wxArrayString & | GetCommandsBeforeBuild () const |
virtual void | AddCommandsBeforeBuild (const wxString &command) |
virtual void | RemoveCommandsBeforeBuild (const wxString &command) |
virtual void | SetCommandsAfterBuild (const wxArrayString &commands) |
virtual const wxArrayString & | GetCommandsAfterBuild () const |
virtual void | AddCommandsAfterBuild (const wxString &command) |
virtual void | RemoveCommandsAfterBuild (const wxString &command) |
virtual void | SetBuildScripts (const wxArrayString &scripts) |
virtual const wxArrayString & | GetBuildScripts () 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 wxString & | GetVar (const wxString &key) const |
virtual const StringHash & | GetAllVars () const |
Private Attributes | |
cbProject * | m_Project |
wxString | m_ExternalDeps |
wxString | m_AdditionalOutputFiles |
BuildTargets | m_TargetDeps |
FilesList | m_Files |
ProjectFileArray | m_FileArray |
bool | m_BuildWithAll |
bool | m_CreateStaticLib |
bool | m_CreateDefFile |
bool | m_UseConsoleRunner |
Friends | |
class | ProjectFile |
Represents a Code::Blocks project build target.
Definition at line 24 of file projectbuildtarget.h.
ProjectBuildTarget::ProjectBuildTarget | ( | cbProject * | parentProject | ) |
Constructor.
Definition at line 24 of file projectbuildtarget.cpp.
References m_BuildWithAll, m_CreateDefFile, m_CreateStaticLib, m_FileArray, and m_UseConsoleRunner.
|
override |
Destructor.
Definition at line 36 of file projectbuildtarget.cpp.
|
virtual |
Targets to be compiled (if necessary) before this one.
Add a target to the list of dependencies of this target. Be careful not to add a target more than once.
target | The build target to add as a dependency. |
Definition at line 146 of file projectbuildtarget.cpp.
References m_TargetDeps.
|
virtual |
Definition at line 64 of file projectbuildtarget.cpp.
References m_AdditionalOutputFiles.
Referenced by DirectCommands::AreExternalDepsOutdated(), ProjectLoader::ExportTargetAsProject(), ExternalDepsDlg::FillAdditional(), and ScriptBindings::RegisterBindings().
|
virtual |
Valid only for targets generating dynamic libraries (DLLs or SOs).
Definition at line 92 of file projectbuildtarget.cpp.
References m_CreateDefFile.
Referenced by ProjectOptionsDlg::DoTargetChange(), ProjectLoader::ExportTargetAsProject(), and ScriptBindings::RegisterBindings().
|
virtual |
Valid only for targets generating dynamic libraries (DLLs or SOs).
Definition at line 106 of file projectbuildtarget.cpp.
References m_CreateStaticLib.
Referenced by ProjectOptionsDlg::DoTargetChange(), ProjectLoader::ExportTargetAsProject(), and ScriptBindings::RegisterBindings().
|
virtual |
Definition at line 50 of file projectbuildtarget.cpp.
References m_ExternalDeps.
Referenced by DirectCommands::AreExternalDepsOutdated(), ProjectLoader::ExportTargetAsProject(), ExternalDepsDlg::FillExternal(), and ScriptBindings::RegisterBindings().
ProjectFile * ProjectBuildTarget::GetFile | ( | int | index | ) |
Access a file of the target.
index | The index of the file. Must be greater or equal than zero and less than GetFilesCount(). |
Definition at line 157 of file projectbuildtarget.cpp.
References m_FileArray, m_Files, and NULL.
Referenced by ScriptBindings::RegisterBindings().
|
inline |
Definition at line 120 of file projectbuildtarget.h.
References ScriptBindings::IOLib::RemoveFile().
Referenced by ScriptBindings::RegisterBindings().
|
inlinevirtual |
Provides an easy way to iterate all the files belonging in this target.
Definition at line 117 of file projectbuildtarget.h.
Referenced by EditorManager::CollectDefines(), cbProject::DuplicateBuildTarget(), and ProjectLoader::ExportTargetAsProject().
|
virtual |
Definition at line 45 of file projectbuildtarget.cpp.
References _T, CompileTargetBase::GetTitle(), and m_Project.
Referenced by DirectCommands::GetTargetLinkCommands(), CompilerGCC::PrintInvalidCompiler(), and ScriptBindings::RegisterBindings().
|
virtual |
Deprecated, do not use at all!
Definition at line 78 of file projectbuildtarget.cpp.
References m_BuildWithAll.
Referenced by DirectCommands::GetCompileCommands(), DirectCommands::GetLinkCommands(), ProjectLoader::Open(), and ScriptBindings::RegisterBindings().
|
virtual |
Definition at line 40 of file projectbuildtarget.cpp.
References m_Project.
Referenced by DirectCommands::AreExternalDepsOutdated(), CDB_driver::GetCommonCommandLine(), cbDebuggerPlugin::GetDebuggee(), CompilerCommandGenerator::GetOrderedIncludeDirs(), CompilerCommandGenerator::GetOrderedLibrariesDirs(), CompilerCommandGenerator::GetOrderedResourceIncludeDirs(), ScriptBindings::RegisterBindings(), MacrosManager::ReplaceMacros(), CompilerCommandGenerator::SetupCompilerOptions(), CompilerMINGWGenerator::SetupIncludeDirs(), CompilerOWGenerator::SetupLibrariesDirs(), CompilerOWGenerator::SetupLinkerOptions(), CompilerCommandGenerator::SetupLinkerOptions(), CompilerOWGenerator::SetupLinkLibraries(), CompilerCommandGenerator::SetupLinkLibraries(), and pfDetails::Update().
|
virtual |
Definition at line 152 of file projectbuildtarget.cpp.
References m_TargetDeps.
|
virtual |
Valid only for targets generating a console executable.
ConsoleRunner is an external utility program that waits for a keypress after the target is executed.
Definition at line 120 of file projectbuildtarget.cpp.
References CompileTargetBase::GetRunHostApplicationInTerminal(), CompileTargetBase::GetTargetType(), m_UseConsoleRunner, and ttConsoleOnly.
Referenced by DebuggerGDB::DoDebug(), ProjectOptionsDlg::DoTargetChange(), ProjectLoader::ExportTargetAsProject(), ScriptBindings::RegisterBindings(), and CompilerGCC::Run().
bool ProjectBuildTarget::RemoveFile | ( | ProjectFile * | pf | ) |
Remove a file from the target.
pf | The pointer to ProjectFile. |
pf
was a valid project file, false if not. Definition at line 175 of file projectbuildtarget.cpp.
References m_FileArray, and m_Files.
|
virtual |
Set a list of all additional output files this targets creates, besides its main output.
If any of the files in this list is older than the list returned by GetExternalDeps(), the target is relinked.
files | A string containing the list of additional files. |
Definition at line 69 of file projectbuildtarget.cpp.
References m_AdditionalOutputFiles, and CompileOptionsBase::SetModified().
Referenced by ProjectLoader::DoBuildTargetOptions(), ExternalDepsDlg::EndModal(), and ScriptBindings::RegisterBindings().
|
virtual |
Set if the target creates a DEF imports file.
Valid only for targets generating dynamic libraries (DLLs or SOs).
createIt | If true, a DEF file is generated else it is not. |
Definition at line 97 of file projectbuildtarget.cpp.
References m_CreateDefFile, and CompileOptionsBase::SetModified().
Referenced by ProjectOptionsDlg::DoBeforeTargetChange(), ProjectLoader::DoBuildTargetOptions(), and ScriptBindings::RegisterBindings().
|
virtual |
Set if an import library should be created.
Valid only for targets generating dynamic libraries (DLLs or SOs).
createIt | If true, an import library will be created else it will not. |
Definition at line 111 of file projectbuildtarget.cpp.
References m_CreateStaticLib, and CompileOptionsBase::SetModified().
Referenced by ProjectOptionsDlg::DoBeforeTargetChange(), ProjectLoader::DoBuildTargetOptions(), and ScriptBindings::RegisterBindings().
|
virtual |
Set a list of all the external files this targets depends on.
If any of the files in this list is newer than the target's output, the target is relinked.
deps | A string containing the list of files. |
Definition at line 55 of file projectbuildtarget.cpp.
References m_ExternalDeps, and CompileOptionsBase::SetModified().
Referenced by ProjectLoader::DoBuildTargetOptions(), ExternalDepsDlg::EndModal(), and ScriptBindings::RegisterBindings().
|
virtual |
Deprecated, do not use at all! Set if this target should be built when the virtual target "All" is selected.
buildIt | If true, the target will be built with "All" else it won't. |
Definition at line 83 of file projectbuildtarget.cpp.
References m_BuildWithAll, and CompileOptionsBase::SetModified().
Referenced by ProjectLoader::DoBuildTargetOptions(), ScriptBindings::RegisterBindings(), Wiz::RunProjectWizard(), and Wiz::RunTargetWizard().
|
overridevirtual |
Set the target's type to pt
.
Reimplemented from CompileTargetBase.
Definition at line 137 of file projectbuildtarget.cpp.
References CompileTargetBase::GetTargetType(), CompileTargetBase::SetTargetType(), SetUseConsoleRunner(), and ttConsoleOnly.
Referenced by ProjectOptionsDlg::DoBeforeTargetChange(), and ProjectLoader::DoBuildTargetOptions().
|
virtual |
Set if ConsoleRunner should be used.
Valid only for targets generating a console executable. ConsoleRunner is an external utility program that waits for a keypress after the target is executed.
useIt | If true, ConsoleRunner is used else it is not. |
Definition at line 128 of file projectbuildtarget.cpp.
References CompileTargetBase::GetTargetType(), m_UseConsoleRunner, CompileOptionsBase::SetModified(), and ttConsoleOnly.
Referenced by ProjectOptionsDlg::DoBeforeTargetChange(), ProjectLoader::DoBuildTargetOptions(), ScriptBindings::RegisterBindings(), and SetTargetType().
|
friend |
Definition at line 135 of file projectbuildtarget.h.
|
private |
Definition at line 139 of file projectbuildtarget.h.
Referenced by GetAdditionalOutputFiles(), and SetAdditionalOutputFiles().
|
private |
Definition at line 143 of file projectbuildtarget.h.
Referenced by GetIncludeInTargetAll(), ProjectBuildTarget(), and SetIncludeInTargetAll().
|
private |
Definition at line 145 of file projectbuildtarget.h.
Referenced by GetCreateDefFile(), ProjectBuildTarget(), and SetCreateDefFile().
|
private |
Definition at line 144 of file projectbuildtarget.h.
Referenced by GetCreateStaticLib(), ProjectBuildTarget(), and SetCreateStaticLib().
|
private |
Definition at line 138 of file projectbuildtarget.h.
Referenced by GetExternalDeps(), and SetExternalDeps().
|
private |
Definition at line 142 of file projectbuildtarget.h.
Referenced by ProjectFile::AddBuildTarget(), GetFile(), ProjectBuildTarget(), ProjectFile::RemoveBuildTarget(), and RemoveFile().
|
private |
Definition at line 141 of file projectbuildtarget.h.
Referenced by ProjectFile::AddBuildTarget(), GetFile(), ProjectFile::RemoveBuildTarget(), and RemoveFile().
|
private |
Definition at line 137 of file projectbuildtarget.h.
Referenced by GetFullTitle(), and GetParentProject().
|
private |
Definition at line 140 of file projectbuildtarget.h.
Referenced by AddTargetDep(), and GetTargetDeps().
|
private |
Definition at line 146 of file projectbuildtarget.h.
Referenced by GetUseConsoleRunner(), ProjectBuildTarget(), and SetUseConsoleRunner().