4 #include <msp/fs/path.h>
5 #include "libbuilder_api.h"
9 An intermediate base class for targets that represent files. Almost all target
10 classes are derived from this.
12 class LIBBUILDER_API FileTarget: public Target
16 Msp::Time::TimeStamp mtime;
18 Msp::FS::Path install_location;
19 bool nested_build_sig = false;
20 bool arch_in_build_sig = false;
22 FileTarget(Builder &b, const Msp::FS::Path &a);
23 FileTarget(Builder &b, const SourcePackage &p, const Msp::FS::Path &a);
25 FileTarget(Builder &, const SourcePackage *, const Msp::FS::Path &);
27 static std::string generate_name(Builder &, const SourcePackage *, const Msp::FS::Path &);
30 const Msp::FS::Path &get_path() const { return path; }
31 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
32 unsigned get_size() const { return size; }
34 bool is_installable() const { return !install_location.empty(); }
35 const Msp::FS::Path &get_install_location() const { return install_location; }
37 /// Changes the mtime of the target to the current time.
41 void check_rebuild() override;
43 virtual std::string create_build_signature() const;
45 void build(Task &) override;
47 void build_finished(bool) override;
50 void clean() override;