简体   繁体   English

确定在Xcode 5工作区中构建项目的顺序(具有静态库项目之间的依赖关系)

[英]Determine order of building projects in Xcode 5 workspace (with dependencies between static library projects)

I am working with an Xcode workspace that combines one iOS application projects with several iOS static library projects. 我正在使用Xcode工作区,它将一个iOS应用程序项目与几个iOS静态库项目相结合。 I've now added a further library B project that is dependent on one of its siblings A and run into a build error whereby the compiler cannot find one of A 's header files when compiling one of B 's files. 我现在添加了另一个库B项目,它依赖于它的一个兄弟A并遇到构建错误,编译器在编译B文件之一时无法找到A的头文件之一。

I assume this has to do with the order in which these projects are built. 我认为这与这些项目的构建顺序有关。 So I am wondering what determines the order of the different steps. 所以我想知道是什么决定了不同步骤的顺序。 How can I be sure that A 's Copy Files build phase (which copies the required header file) executes before B 's file are compiled. 如何在编译B文件之前确定A复制文件构建阶段( 复制所需的头文件)。 I can see the apparent order of source files for compilation in the target's Compile Sources build phase; 我可以在目标的Compile Sources构建阶段看到编译源文件的明显顺序; is there a similar list that determines the "order" of projects inside the workspace. 是否有类似的列表,用于确定工作区内项目的“顺序”。 The project navigator view imposes one, but swapping A and B in that view does not remedy the problem. 项目导航器视图强加一个,但在该视图中交换AB并不能解决问题。

Has any one succeeded with this kind of setup (cross-dependency between static library projects in a workspace, all compiled into a single bundle) and what was the required configuration? 有没有人成功进行这种设置(工作空间中的静态库项目之间的交叉依赖,所有都编译成一个包)以及所需的配置是什么?

In the scheme under 'Build' you can drag the targets used into a specific order. 在“构建”下的方案中,您可以将使用的目标拖动到特定顺序中。 If you un-check the 'Parallelize Build' option the targets are built in the specified order. 如果取消选中“Parallelize Build”选项,则会按指定的顺序构建目标。 So the later ones can have dependencies to the earlier ones. 所以后者可以依赖于早期的依赖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM