Effect of ALWAYS_SEARCH_USER_PATHS NO vs YES

Viewed 1493

I am using Xcode 9.2 , I put ALWAYS_SEARCH_USER_PATHS=NO it will show some error ,one of my file.h is not found in the project but it is present in the project folders. But when I put ALWAYS_SEARCH_USER_PATHS=yes, it is compiled without any error .

please refer the project requirement for Adobe sdKCC2020

Other project changes to note

In common.xcconfig, CLANG_CXX_LANGUAGE_STANDARD has been set to gnu++14 i.e. the code is compiled as GNU C++-14 compliant.
BOOST_SPIRIT_THREADSAFE has been defined centrally in common.xcconfig.
ALWAYS_SEARCH_USER_PATHS has been set to NO in common.xcconfig. You may need to change #include statements that were using user search

path files but with syntax "#include " and replace them with syntax "#include """. This change is being done proactively as the setting ALWAYS_SEARCH_USER_PATHS is deprecated in future versions of Xcode.

though header file is include #include "file.h",and it found in the project source folder

Simply I can't understand the project requirement for sdkCC2020 and difference between ALWAYS_SEARCH_USER_PATHS=Yes to ALWAYS_SEARCH_USER_PATHS=No

1 Answers

https://help.apple.com/xcode/mac/11.4/#/itcaec37c2a6

Refer to the documentation above. The setting is deprecated in Xcode 10 and above.

The legacy header map that was generated when the Always Search User Paths (ALWAYS_SEARCH_USER_PATHS) setting was YES is not supported by the new build system. Instead, set ALWAYS_SEARCH_USER_PATHS to NO and migrate to using modern header include syntax. Add any needed header files that are in the project repository to the Xcode project to ensure they are available for use in #include (via the project wide header map). Use quote-style include ("example.h") for project headers, and reserve angle-bracket include (<example.h>) for system headers.

https://developer.apple.com/documentation/xcode-release-notes/build-system-release-notes-for-xcode-10

So for user headers:

  • add them to the Xcode project
  • Or set USER_HEADER_SEARCH_PATHS to the path to the include files, relative to $SRCROOT.

For system headers:

  • Set SYSTEM_HEADER_SEARCH_PATHS to the path to system/ external library include files.
Related