]> git.tdb.fi Git - builder.git/commitdiff
Hacky support for OS X frameworks
authorMikko Rasa <tdb@tdb.fi>
Tue, 28 May 2013 12:23:35 +0000 (15:23 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 28 May 2013 12:23:35 +0000 (15:23 +0300)
This isn't very elegant, but I need more time to come up with a proper
implementation.

source/binary.cpp
source/gnulinker.cpp

index a3f3c9b4ec71dd4c70439b1150fcb2cd996a8366..b3b882d314427f6bf8efdd73b50210edd50d1112 100644 (file)
@@ -43,6 +43,9 @@ void Binary::find_dependencies()
                const BuildInfo &binfo = c->get_build_info();
                for(BuildInfo::WordList::const_iterator i=binfo.libs.begin(); i!=binfo.libs.end(); ++i)
                {
+                       if(i->size()>10 && !i->compare(i->size()-10, 10, ".framework"))
+                               continue;
+
                        BuildInfo::LibraryMode libmode = component->get_build_info().get_libmode_for(*i);
                        Target *lib = builder.get_vfs().find_library(*i, binfo.libpath, libmode);
                        if(lib)
index b2516d6394eab3ddec5733d10347e0d43923e721..a56d716780817cdd63f3e9536584bc242ac19b78 100644 (file)
@@ -246,6 +246,13 @@ Task *GnuLinker::Linker::run(const Target &target) const
                }
        }
 
+       for(BuildInfo::WordList::const_iterator i=binfo.libs.begin(); i!=binfo.libs.end(); ++i)
+               if(i->size()>10 && !i->compare(i->size()-10, 10, ".framework"))
+               {
+                       argv.push_back("-framework");
+                       argv.push_back(i->substr(0, i->size()-10));
+               }
+
        if(need_l_objc)
                argv.push_back("-lobjc");
        if(static_link_ok)