Target Info APIs#

source_api.h#

template<typename T>
class SourceApi#

Subclassed by buildcc::TargetInfo

Public Functions

inline std::vector<std::string> GetSourceFiles() const#
inline void AddSourceAbsolute(const fs::path &absolute_source)#
inline void GlobSourcesAbsolute(const fs::path &absolute_source_dir)#
inline void AddSource(const fs::path &relative_source, const fs::path &relative_to_target_path = "")#
inline void GlobSources(const fs::path &relative_to_target_path = "")#

include_api.h#

template<typename T>
class IncludeApi#

Public Functions

inline std::vector<std::string> GetHeaderFiles() const#
inline const std::vector<std::string> &GetIncludeDirs() const#
inline void AddHeaderAbsolute(const fs::path &absolute_filepath)#
inline void GlobHeadersAbsolute(const fs::path &absolute_path)#
inline void AddIncludeDirAbsolute(const fs::path &absolute_include_dir, bool glob_headers = false)#
inline void AddHeader(const fs::path &relative_filename, const fs::path &relative_to_target_path = "")#
inline void GlobHeaders(const fs::path &relative_to_target_path = "")#
inline void AddIncludeDir(const fs::path &relative_include_dir, bool glob_headers = false)#

lib_api.h#

template<typename T>
class LibApi#

Subclassed by buildcc::TargetInfo

Public Functions

inline std::vector<std::string> GetLibDeps() const#
inline const std::vector<std::string> &GetExternalLibDeps() const#
inline const std::vector<std::string> &GetLibDirs() const#
inline void AddLibDirAbsolute(const fs::path &absolute_lib_dir)#
inline void AddLibDir(const fs::path &relative_lib_dir)#
inline void AddLibDep(const std::string &lib_dep)#
void AddLibDep(const Target &lib_dep)#

pch_api.h#

template<typename T>
class PchApi#

Public Functions

inline std::vector<std::string> GetPchFiles() const#
inline void AddPchAbsolute(const fs::path &absolute_filepath)#
inline void AddPch(const fs::path &relative_filename, const fs::path &relative_to_target_path = "")#

flag_api.h#

template<typename T>
class FlagApi#

Subclassed by buildcc::TargetInfo

Public Functions

inline void AddPreprocessorFlag(const std::string &flag)#
inline void AddCommonCompileFlag(const std::string &flag)#
inline void AddPchCompileFlag(const std::string &flag)#
inline void AddPchObjectFlag(const std::string &flag)#
inline void AddAsmCompileFlag(const std::string &flag)#
inline void AddCCompileFlag(const std::string &flag)#
inline void AddCppCompileFlag(const std::string &flag)#
inline void AddLinkFlag(const std::string &flag)#
inline const std::vector<std::string> &GetPreprocessorFlags() const#
inline const std::vector<std::string> &GetCommonCompileFlags() const#
inline const std::vector<std::string> &GetPchCompileFlags() const#
inline const std::vector<std::string> &GetPchObjectFlags() const#
inline const std::vector<std::string> &GetAsmCompileFlags() const#
inline const std::vector<std::string> &GetCCompileFlags() const#
inline const std::vector<std::string> &GetCppCompileFlags() const#
inline const std::vector<std::string> &GetLinkFlags() const#

deps_api.h#

template<typename T>
class DepsApi#

Public Functions

inline std::vector<std::string> GetCompileDependencies() const#
inline std::vector<std::string> GetLinkDependencies() const#
inline void AddCompileDependencyAbsolute(const fs::path &absolute_path)#

Recompile sources to object if compile dependency is removed, added or newer from the previous build.

inline void AddCompileDependency(const fs::path &relative_path)#

Recompile sources to object if compile dependency is removed, added or newer from the previous build.

inline void AddLinkDependencyAbsolute(const fs::path &absolute_path)#

Relink target if link dependency is removed, added or newer from previous build.

inline void AddLinkDependency(const fs::path &relative_path)#

Relink target if link dependency is removed, added or newer from previous build.

sync_api.h#

template<typename T>
class SyncApi#

Subclassed by buildcc::TargetInfo

Public Functions

void Copy(const T &target, std::initializer_list<SyncOption> options)#

Copy/Replace selected variables when Target supplied by const reference.

void Copy(T &&target, std::initializer_list<SyncOption> options)#

Copy/Replace selected variables when Target supplied by move.

void Insert(const T &target, std::initializer_list<SyncOption> options)#

Insert selected variables when Target supplied by const reference.

void Insert(T &&target, std::initializer_list<SyncOption> options)#

Insert selected variables when Target supplied by move.

TargetInfo#

target_info.h#

class TargetInfo : public buildcc::internal::SourceApi<TargetInfo>, public buildcc::internal::IncludeApi<TargetInfo>, public buildcc::internal::LibApi<TargetInfo>, public buildcc::internal::PchApi<TargetInfo>, public buildcc::internal::FlagApi<TargetInfo>, public buildcc::internal::DepsApi<TargetInfo>, public buildcc::internal::SyncApi<TargetInfo>, public buildcc::internal::TargetEnvApi<TargetInfo>#

Subclassed by buildcc::Target

Public Functions

inline TargetInfo(const BaseToolchain &toolchain, const TargetEnv &env)#

Friends

friend class internal::SourceApi< TargetInfo >
friend class internal::IncludeApi< TargetInfo >
friend class internal::LibApi< TargetInfo >
friend class internal::PchApi< TargetInfo >
friend class internal::FlagApi< TargetInfo >
friend class internal::DepsApi< TargetInfo >
friend class internal::SyncApi< TargetInfo >
friend class internal::TargetEnvApi< TargetInfo >
typedef TargetInfo buildcc::BaseTargetInfo#

Target APIs#

Important

Target APIs can also use TargetInfo APIs

target_env.h#

template<typename T>
class TargetEnvApi#

Public Functions

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

Target#

target.h#

class Target : public buildcc::internal::BuilderInterface, public buildcc::TargetInfo, public buildcc::internal::TargetGetter<Target>#

Subclassed by buildcc::DynamicTarget_gcc, buildcc::DynamicTarget_generic, buildcc::DynamicTarget_msvc, buildcc::ExecutableTarget_gcc, buildcc::ExecutableTarget_generic, buildcc::ExecutableTarget_msvc, buildcc::StaticTarget_gcc, buildcc::StaticTarget_generic, buildcc::StaticTarget_msvc, buildcc::Target_generic

Public Functions

inline explicit Target(const std::string &name, TargetType type, const Toolchain &toolchain, const TargetEnv &env, const TargetConfig &config = TargetConfig())#
virtual ~Target() = default#
Target(const Target &target) = delete#
virtual void Build() override#

Friends

friend class internal::CompilePch
friend class internal::CompileObject
friend class internal::LinkTarget
friend class internal::TargetGetter< Target >
typedef Target buildcc::BaseTarget#

Specialized Target#

target_custom.h#

typedef BaseTarget buildcc::Target_custom#

target_gcc.h#

class ExecutableTarget_gcc : public buildcc::Target#

Subclassed by buildcc::ExecutableTarget_mingw

Public Functions

inline ExecutableTarget_gcc(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const TargetConfig &config = GccConfig::Executable())#
class StaticTarget_gcc : public buildcc::Target#

Public Functions

inline StaticTarget_gcc(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const TargetConfig &config = GccConfig::StaticLib())#
class DynamicTarget_gcc : public buildcc::Target#

Subclassed by buildcc::DynamicTarget_mingw

Public Functions

inline DynamicTarget_gcc(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const TargetConfig &config = GccConfig::DynamicLib())#

target_msvc.h#

class ExecutableTarget_msvc : public buildcc::Target#

Public Functions

inline ExecutableTarget_msvc(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const TargetConfig &config = MsvcConfig::Executable())#
class StaticTarget_msvc : public buildcc::Target#

Public Functions

inline StaticTarget_msvc(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const TargetConfig &config = MsvcConfig::StaticLib())#
class DynamicTarget_msvc : public buildcc::Target#

Public Functions

inline DynamicTarget_msvc(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const TargetConfig &config = MsvcConfig::DynamicLib())#
inline const fs::path &GetDllPath()#

target_generic.h#

class ExecutableTarget_generic : public buildcc::Target#

Public Functions

inline ExecutableTarget_generic(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const env::optional<TargetConfig> &config = {})#
inline ~ExecutableTarget_generic()#
class StaticTarget_generic : public buildcc::Target#

Public Functions

inline StaticTarget_generic(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const env::optional<TargetConfig> &config = {})#
class DynamicTarget_generic : public buildcc::Target#

Public Functions

inline DynamicTarget_generic(const std::string &name, const BaseToolchain &toolchain, const TargetEnv &env, const env::optional<TargetConfig> &config = {})#
class Target_generic : public buildcc::Target#

Public Functions

inline Target_generic(const std::string &name, TargetType type, const BaseToolchain &toolchain, const TargetEnv &env, const env::optional<TargetConfig> &config = {})#

Example#

 1// Generic toolchain GCC
 2Toolchain_gcc gcc;
 3
 4// Target compatible GCC toolchain
 5ExecutableTarget_gcc hello_world("name", gcc, "relative_to_global_env_root_dir");
 6
 7// NOTE: See APIs above, they are self explanatory
 8hello_world.AddSource("");
 9
10// Setup the tasks
11hello_world.Build();
12
13// Run the task
14tf::Executor executor;
15executor.run(hello_world.GetTaskflow());
16executor.wait_for_all();