What does it mean when you check on “Recursive” in Header Search Paths

前端 未结 4 553
感情败类
感情败类 2020-11-30 10:56

I\'ve been referencing a lot of Projects, and i do it through adding their paths in Header Search Paths.

I\'ve been following the referencing stuffs through the \"Re

相关标签:
4条回答
  • 2020-11-30 11:33

    1) Enter your desired path for Header Search Paths, click enter.

    2) Double click the path text that you entered.

    3) On the right of the dialog box select recursive.

    0 讨论(0)
  • 2020-11-30 11:40

    When you set a path(e.g. Header Search Paths, Library Search Paths, Framework Search Paths...) you can define a path to one of parent folder and set recursive(/** will be added to the end of the path). For example you can defile a path to a include directory(or more over to a Build directory) with recursive parameter instead of include/<target_name>.

    Please note: If the patch contains spaces - , you should escape them using \ or enclose the path in double quotes ""

    0 讨论(0)
  • 2020-11-30 11:44

    For those wondering, as I was, what the effect of choosing recursive for a Header Search Path is on the compiler command line, it's to generate a -I argument for every directory in the tree rooted at the given path. This can lead to very long compiler command lines which will make looking for anything else in there well nigh impossible. So it's worth considering how many directories are below the path you are specifying if you want to use recursive.

    I tried specifying -I../path/to/subproject/** as a Compiler Flag for an individual file but that doesn't work (which is obviously why Xcode does the expansion itself).

    (this is true for Xcode 9.4.1)

    0 讨论(0)
  • 2020-11-30 11:48

    If you give Xcode a path to use for headers, it will check that path when you use an #include or #import statement. If the file isn't there, it quits.

    If you have the path set as "recursive", Xcode will search folders it finds there if it doesn't find the file.

    Looks like this:

    0 讨论(0)
提交回复
热议问题