]> git.tdb.fi Git - builder.git/commitdiff
Explicitly add -lmingw32 before any other libraries
authorMikko Rasa <tdb@tdb.fi>
Fri, 16 Sep 2016 22:32:45 +0000 (01:32 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 16 Sep 2016 22:32:45 +0000 (01:32 +0300)
This fixes linking when WinMain() is in a library (such as libmspcore)
and shouldn't be harmful when it isn't.

source/gnulinker.cpp

index 75a1bac280609086da046f86e3c71e1cc115d5e5..1b969b4c06882755926da76c57ec83e73144fddf 100644 (file)
@@ -228,6 +228,9 @@ Task *GnuLinker::Linker::run(const Target &target) const
 
        bool static_link_ok = (binfo.libmode<=BuildInfo::STATIC);
 
+       if(architecture->get_system()=="windows" && architecture->get_cross_prefix().find("mingw")!=string::npos)
+               argv.push_back("-lmingw32");
+
        const Target::Dependencies &depends = target.get_dependencies();
        for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i)
        {