The workspace with the iOS project and related a static library project

前端 未结 7 1650
盖世英雄少女心
盖世英雄少女心 2021-02-02 03:11

I am fighting with Xcode 4 workspaces. Currently Xcode 4 wins. Thus, my situation:

I have the workspace with the iOS app project. There is also static library project iO

7条回答
  •  孤独总比滥情好
    2021-02-02 03:15

    Here is a solution a get from Apple DTS. I don't like it, because it is suggests to use absolute path. But I still publish it here, maybe someone feels it is right for him.


    How to set up the static library:

    • Add a build configuration named "Archive" by copying the Release Configuration.
    • Move your headers to the Project group of the Copy Headers build phase.
    • Set the Per-configuration Build Products Path of the "Archive" configuration to $(BUILD_DIR)/MyLibBuildDir. Xcode will create the MyLibBuildDir folder inside the BuildProductsPath, then add your static library into that folder. You can use "MyLibBuildDir" or provide another name for the above folder.
    • Set Skip Install to YES for all configurations.
    • Set Installation Directory of "Archive" to $(TARGET_TEMP_DIR)/UninstalledProducts.
    • Edit its scheme, set the Build Configuration of its Archive action to "Archive."

    How to set up the project linking against the library:

    • Add a build configuration named "Archive" by copying the Release Configuration.
    • Set the Library Search Paths of "Archive" to $(BUILD_DIR)/MyLibBuildDir.
    • Set the User Header Search Paths to the recursive absolute path of your root of your workspace directory for all configurations.
    • Set Always Search User Paths of "Archive" to YES.
    • Set Skip_Install to NO for all configurations.
    • Edit its scheme, set the Build Configuration of its Archive action to "Archive."

提交回复
热议问题