(Original) runscript for joint compilation of LIB projects and app projects in xcode4 Workspace

Source: Internet
Author: User

This article is original. repost the famous source.
This article explains how to configure Project Association in the workspace of xcode4, but this is not the only method.

Create a workspace, add an iOS lib project called LIBA, add an iOS lib project called libb, and then add an app project called APPC.

Scenario: the APPC project uses the libs generated by the LIBA and libb projects.

Both lib projects are configured in the same way. Here we use LIBA as an example:
1. Set the public headers of Lib.
2. Select the target of the LIBA project and set installation directory to $ (built_products_dir) in build settings)

Configure the APPC project:

First, link the APPC to each Lib:
1. Select the target-APPC of the APPC project and add libliba. A and liblibb. A to link binary with libraries of build phases.

Then let the APPC see the public header files of each Lib:
1. Select the APPC project and click Add target: IOS, other, and aggregate next. The target is named runscript.
2. Select the target-runscript of the APPC project and open add build phase/Add run script under build phases.
The input script is as follows:
Rm-RF $ {project_dir}/$ {project_name}/libsheaders/
Mkdir $ {project_dir}/$ {project_name}/libsheaders/
CD $ {built_products_dir}
Find.-Name"*. H"-Exec CP'{}'$ {Project_dir}/$ {project_name}/libsheaders /\;# Copy all the Lib's public header files.
3. select target-APPC for the APPC project,
Add target-runscript to target dependencies of build phases.
Set always search user paths to yes in build settings, and set user header search paths to $ {project_dir}/$ {project_name}/libsheaders/
(That is, the target directory of the header file copied by the above script)

 

End

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.