Build system-Part 1-Discard build panel

Source: Internet
Author: User
Tags configuration settings

The original Article is wonderful. Address: http://robnapier.net/blog/build-system-1-build-panel-360#more-360

I used xcode 3.2.5 To follow the original article step by step, and the results were slightly different, but it didn't matter.

Start of Text

Xcode has an advanced build system. With a few more improvements, you can make your project easier to set/maintain and reduce the build time.

Building a panel is easy to use, but with the complexity of the settings, its use will become increasingly confusing. E.g. You need to maintain a legacy C ++ code. If thumb code generation conflicts with a hacker, you have to disable thumb. At this time, write some comments as the best policy to prevent thumb from being opened accidentally in the "later. However, building a panel won't help you, and you won't be able to add comments. Dedicated comments panel cannot help much.

Xcode provides a more advanced solution: xcconfig file. All that can be done through Build panel, or xcconfig. You can also add comments.

Procedure

1. Create a window-based application.

2. Name the project and select the storage directory. I put it in the prjoects directory.

3. Check the directory created by prjoect. Xcmg demo has been created.

4. Create a new group for groups & files to store all xcconfig files.

5. I named it build configurations.

6. Add a new xcconfig file to the group.

7. Select Configuration Settings file.

8. Name the new file shared. xcconfig. The configurations shared by debug and release will be stored in the future.

9. Create three more. Specifically, application. xcconfig is used for target configuration.

10. Double-click the project name xcw.demo in groups & files. The project Info panel is displayed, and the build page is selected. Then,

    • Select debug for configuration;
    • Show select Settings defined at this level.

Press cmd-a to select all configurations. So they become blue below. Then press cmd-C to copy it to the clipboard.

11. Select the Debug. xcconfig file and press cmd-V to copy the content in the clipboard to the file.

12. Return to the build panel and delete all the configurations you just selected. In this way, they are restored to the default value.

13. Set show: all settings. You will find that many values are changed to the default value. In the build panel, select base on in the lower right corner and select debug. You will find that the original settings areBack.

14. Perform the processing according to law, copy the release settings, clear the build panel, and select a new based on.

15. Double-click your target, that is, the default xcsung demo generated under targests. Then, follow steps 10-14 to move both Debug and release to application. xcconfig. Note that you must add notes to indicate the two independent parts.

16. Select Configuration: all deployments, and based on: application.

Now the settings are moved to the xcconfig file, but there is still some confusion. Next we will clean up.

17. Process application. xcconfig first. Move all the items in debug and release to debug. xcconfig. Similarly, move the items in release and those in debug to release. xcconfig. Both are available. Delete the duplicate part and leave only one of them.

18. Process Debug. xcconfig and release. xcconfig again. Move all of them to shared. xcconfig. Add# Include "shared. xcconfig".

Preview

Now everything is over. Let's take a look at what the four files look like:

Now there should be no problem with compiling links.

PS: If your file is different from mine, we are less likely to be correct.

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.