Target Utils#

Commonly used Utils (Classes / Structs) for Generator, TargetInfo and Target classes.

target_type.h#

enum class buildcc::TargetType#

Values:

enumerator Executable#

Executable Target type.

enumerator StaticLibrary#

Static library target type.

enumerator DynamicLibrary#

Dynamic library target type.

enumerator Undefined#

Undefined target type.

target_env.h#

class TargetEnv#

Public Functions

inline TargetEnv(const char *target_relative_to_env_root)#

Change the relative root path for a particular Generator / Target.

Absolute root now changes to Project::GetRootDir() / target_relative_to_env_root

Absolute build dir remains the same.

Can be used implicitly

Parameters

target_relative_to_env_root – Change root dir with respect to Project::GetRootDir()

inline explicit TargetEnv(const fs::path &target_relative_to_env_root)#

Similar to TargetEnv(const char *)

Only explicit usage allowed

Parameters

target_relative_to_env_root – Change root dir with respect to Project::GetRootDir()

inline explicit TargetEnv(const fs::path &absolute_target_root, const fs::path &absolute_target_build)#

Change the absolute root and build path for a particular Generator / Target.

Parameters
  • absolute_target_root – Absolute root directory for this target changes as per this parameter

  • absolute_target_build – Absolute build directory for this target changes as per this parameter

inline const fs::path &GetTargetRootDir() const#
inline const fs::path &GetTargetBuildDir() const#

target_config.h#

struct TargetConfig#

Public Functions

TargetConfig() = default#

Public Members

std::string target_ext = {""}#
std::string pch_command = {"{compiler} {preprocessor_flags} {include_dirs} {common_compile_flags} {pch_compile_flags} {compile_flags} -o {output} -c {input}"}#
std::string compile_command = {"{compiler} {preprocessor_flags} {include_dirs} {common_compile_flags} {pch_object_flags} {compile_flags} -o {output} -c {input}"}#

target_state.h#

struct TargetState#

Public Functions

void BuildCompleted()#
void SourceDetected(FileExt file_extension)#
void PchDetected()#
inline bool IsBuilt() const#
inline bool ContainsPch() const#
inline bool ContainsAsm() const#
inline bool ContainsC() const#
inline bool ContainsCpp() const#