yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
7.03k stars 818 forks source link

Dependencies: dynamic library linkage #271

Open libe opened 6 years ago

libe commented 6 years ago

Hello,

I am having troubles trying to link a dynamic library with the following spec

MyFramework:
  type: framework
  platform: iOS
  deploymentTarget: "11.0"
  dependencies: 
    - framework: deps/Curl/libcurl.a
      embed: true

When I inspect the Xcode project generated I can see that the library appears in the Link Frameworks section but the at link time I get the error -lcurl not found.

Is linking dynamic libraries supported? From the docs it is not explicitly mentioned it seems.

Thanks again for this great tool!

Libe

yonaskolb commented 6 years ago

Hi Libe Does the solution posted in #192 solve your issue, by adding the dependency to FRAMEWORK_SEARCH_PATHS?

libe commented 6 years ago

Hello,

I managed to solve the issue by using the OTHER_LDFLAGS and LIBRARY_SEARCH_PATHS variables to link with the shared libraries. I don't know if FRAMEWORK_SEARCH_PATHS can get the job done in the same way (I only have a precompiled .a library).