]> git.tdb.fi Git - builder.git/blob - source/objectfile.h
Don't rely on component type in determining whether to use -fPIC
[builder.git] / source / objectfile.h
1 #ifndef OBJECTFILE_H_
2 #define OBJECTFILE_H_
3
4 #include "filetarget.h"
5
6 class SourceFile;
7
8 /**
9 Object files are compiled from source files.
10 */
11 class ObjectFile: public FileTarget
12 {
13 private:
14         SourceFile &source;
15         bool used_in_shlib;
16
17 public:
18         ObjectFile(Builder &, const Component &, SourceFile &);
19 private:
20         static Msp::FS::Path generate_target_path(const Component &, const Msp::FS::Path &);
21
22 public:
23         virtual const char *get_type() const { return "ObjectFile"; }
24         SourceFile &get_source() const { return source; }
25
26         void set_used_in_shared_library(bool);
27         bool is_used_in_shared_library() const { return used_in_shlib; }
28
29         virtual void collect_build_info(BuildInfo &) const;
30
31 private:
32         virtual void find_dependencies();
33
34         void find_dependencies(FileTarget *);
35 };
36
37 #endif