Reputation: 523
Is there a way to specify iOS libraries to be linked while building an app from command line using xcodebuild command? I know we can specify third party frameworks using OTHER_LDFLAGS="..path/to/framework" but since the built in framework paths may vary based on the machine/sdk etc, I'm assuming there could be some better way than that.
Thanks
Upvotes: 1
Views: 6496
Reputation: 299605
xcodebuild
builds project files, so typically you configure everything in the project rather than passing many configuration parameters. To link built-in frameworks, you just use the Link with Libraries build step and add the frameworks you want. Built-in frameworks should automatically be stored as SDK-relative. (Note that you should basically never use this to link relative-path libraries in your package; it is usually better to use OTHER_LIBTOOLFLAGS
for those.)
The linker flag you want if you need it is -framework <name>
. But you shouldn't need that very often when using xcodebuild
. It's mostly used when calling clang
or ld
directly.
Upvotes: 1