在xcode中保留包含路径 [英] preserve include path in xcode
问题描述
我将文件头文件分隔到如下文件夹中:
I separated my header files in folders like:
libraryA
|-libA1.h
|-libA2.h
libraryB
|-libB1.h
|-libB2.h
Xcode默认会删除路径,所以
Xcode however removes the path by default, so
#include "libraryA/libA1.h"
#include "libraryB/libB1.h"
不起作用,只有:
$ b
doesn't work, only:
#include "libA1.h"
#include "libB1.h"
如何让xcode保留包含的路径名?
How can I make xcode preserve the path names for includes?
推荐答案
在目标的构建窗格中,将Header Search Paths设置为$(SRCROOT)(假设这些位于顶层)或$(SRCROOT)/ include或任何匹配。为了简单起见,我只建议在这里使用构建窗格。我实际上推荐人们放弃构建窗格并使用xcconfig文件,在这种情况下,设置为HEADER_SEARCH_PATHS。
In the build pane for the target, set Header Search Paths to $(SRCROOT) (assuming these are at the top level), or $(SRCROOT)/include, or whatever matches. I only suggest using the build pane here for simplicity sake. I actually recommend that people abandon the build pane and use xcconfig files, in which case, the setting is HEADER_SEARCH_PATHS.
这篇关于在xcode中保留包含路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!