]> git.tdb.fi Git - builder.git/blob - source/lib/objectfile.h
Refactor transitive dependencies to work on all targets
[builder.git] / source / lib / objectfile.h
1 #ifndef OBJECTFILE_H_
2 #define OBJECTFILE_H_
3
4 #include "filetarget.h"
5 #include "libbuilder_api.h"
6
7 class SourceFile;
8
9 /**
10 Object files are compiled from source files.
11 */
12 class LIBBUILDER_API ObjectFile: public FileTarget
13 {
14 private:
15         SourceFile &source;
16         bool used_in_shlib = false;
17
18 public:
19         ObjectFile(Builder &, const Component &, SourceFile &);
20 private:
21         static Msp::FS::Path generate_target_path(const Component &, const Msp::FS::Path &);
22
23 public:
24         const char *get_type() const override { return "ObjectFile"; }
25         SourceFile &get_source() const { return source; }
26
27         void set_used_in_shared_library(bool);
28         bool is_used_in_shared_library() const { return used_in_shlib; }
29
30         void collect_build_info(BuildInfo &) const override;
31 };
32
33 #endif