]> git.tdb.fi Git - builder.git/blobdiff - source/sharedlibrary.cpp
Split Component into several subclasses
[builder.git] / source / sharedlibrary.cpp
index 6600b740332a23dff7a882a0a63e6c99afcbd8ec..6c816bd43bf3d5cf0cebdc425ada3d01d2e225fe 100644 (file)
@@ -1,7 +1,7 @@
 #include <msp/fs/utils.h>
 #include <msp/strings/format.h>
+#include "binarycomponent.h"
 #include "builder.h"
-#include "component.h"
 #include "objectfile.h"
 #include "sharedlibrary.h"
 #include "sourcepackage.h"
@@ -28,7 +28,8 @@ SharedLibrary::SharedLibrary(Builder &b, const Component &c, const list<ObjectFi
        else
                install_location = "lib";
 
-       if(component->get_type()==Component::MODULE)
+       const BinaryComponent &bcomp = dynamic_cast<const BinaryComponent &>(*component);
+       if(bcomp.get_type()==BinaryComponent::MODULE)
                install_location /= package->get_name();
        else
        {
@@ -59,7 +60,8 @@ SharedLibrary::SharedLibrary(Builder &b, const Component &c, const list<ObjectFi
 
 string SharedLibrary::generate_filename(const Component &comp)
 {
-       if(comp.get_type()==Component::MODULE)
+       const BinaryComponent &bcomp = dynamic_cast<const BinaryComponent &>(comp);
+       if(bcomp.get_type()==BinaryComponent::MODULE)
                return comp.get_name()+".m";
        else
        {