]> git.tdb.fi Git - builder.git/blobdiff - source/gnucompiler.cpp
Target::prepare shouldn't be virtual
[builder.git] / source / gnucompiler.cpp
index 8df1a72a92debc7542df10f137f76d29f1f8e18a..36903937546a678f07e59e4bc2f101ddcb47b474 100644 (file)
@@ -40,7 +40,7 @@ Target *GnuCompiler::create_target(const list<Target *> &sources, const string &
 Task *GnuCompiler::run(const Target &target) const
 {
        const ObjectFile &object = dynamic_cast<const ObjectFile &>(target);
-       const Component &comp = object.get_component();
+       const Component &comp = *object.get_component();
 
        ExternalTask::Arguments argv;
        argv.push_back(executable->get_path().str());
@@ -69,7 +69,7 @@ Task *GnuCompiler::run(const Target &target) const
        }
        if(binfo.threads)
                argv.push_back("-pthread");
-       if(comp.get_type()==Component::LIBRARY)
+       if(comp.get_type()==Component::LIBRARY && architecture->get_system()!="windows")
                argv.push_back("-fPIC");
 
        const Architecture &native_arch = builder.get_native_arch();