PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, August 21, 2022

[FIXED] What the different between SRCROOT and PROJECT_DIR?

 August 21, 2022     environment-variables, ios, xcode     No comments   

Issue

In Xcode, we have to configure many paths in the Build Settings, then we will deal with the $(SRCROOT) and $(PROJECT_DIR) , But what the difference between them, can you show me an example, thx a lot.


Solution

Exchangeable in practice, while the documentation makes these subtle theoretical distinctions:

  1. SRCROOT

    Directory path. Identifies the directory containing the target’s source files: contains the path to the project file that defines the target.

    SOURCE_ROOT is an undocumented alias to SRCROOT

  2. PROJECT_DIR
    Identifies the directory containing the project (.xcodeproj)
    $(PROJECT_DIR)/build is used as the create the default value for:

    • Intermediate Build Files Path OBJROOT
    • Build Products Path SYMROOT

    Typically these paths are not set per target, but are set per-project or per-user.

  3. PROJECT_FILE_PATH
    Identifies the project itself.
    Equivalent to $(PROJECT_DIR)/$(PROJECT_NAME).xcodeproj

Conceptually different (#1 is about the project which defines the target while #2 is about the project independently of any target), they are always pointing to the same location since you are, in essence, always building a target.

References

Xcode 8.3 Build Settings reference
Xcode Build System Guide (Retired 2016-09-29)



Answered By - SwiftArchitect
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing