]> git.tdb.fi Git - builder.git/blobdiff - source/staticlibrary.h
Use build info to store static library dependencies
[builder.git] / source / staticlibrary.h
index 0d1242f31d96825dd198b4ed23027202d92c1b35..c76b314cd441021cbffc99c8ee968eb4d69b7e42 100644 (file)
@@ -1,22 +1,33 @@
-#ifndef STATICLIB_H_
-#define STATICLIB_H_
+#ifndef STATICLIBRARY_H_
+#define STATICLIBRARY_H_
 
-#include "target.h"
+#include "filetarget.h"
 
 class Component;
 class ObjectFile;
 
-class StaticLibrary: public Target
+/**
+A static library target.
+*/
+class StaticLibrary: public FileTarget
 {
+private:
+       /* TODO this really belongs in a Component, but some refactoring is required
+       to allow non-builder packages to have components.  Rename BinaryPackage to
+       ExternalPackage, add BuildableComponent and ExternalComponent classes. */
+       BuildInfo build_info;
+
 public:
+       StaticLibrary(Builder &, const Msp::FS::Path &);
        StaticLibrary(Builder &, const Component &, const std::list<ObjectFile *> &);
-       const char      *get_type() const      { return "StaticLibrary"; }
-       const Component &get_component() const { return comp; }
-       Action          *build();
 private:
-       const Component &comp;
+       static std::string generate_filename(const Component &);
+
+public:
+       virtual const char *get_type() const { return "StaticLibrary"; }
 
-       std::string generate_target_name(const Component &);
+       void add_required_library(const std::string &);
+       virtual void collect_build_info(BuildInfo &) const;
 };
 
 #endif