Building via Xcode
******************

Checkout Sources
================

     [file method.checkout.texi not included]

Build
=====

In Xcode perform the following steps to build the default configuration:

  * open macosx/HandBrake.xcodeproj

  * select active configuration standard

  * select active target HandBrake

  * click Build or Build and Go

The first build (on an empty build directory) will take a bit of time. You may use the Build Results window to observe progress. The most time-consuming part of the build is when the external build system (essentially the terminal method) is triggered by Xcode and a substantial amount of log transcript ensues. Much of that transcript are warnings and errors that are part of the normal build process for 3rd-party contributed modules so in general you need not do anything. However, if Xcode itself reports the build failed, then you must take corrective action.

Unfortunately, due to limitations of Xcode we do not have hooks in place to offer finer-grained control over per-module make actions for the (external) build system. Thus, you will have to use terminal to accomplish those tasks. Just cd into the build directory which is associated with your active configuration and perform any necessary make commands. Be careful not to issue commands from the terminal simultaneously with Xcode tasks as that will confuse both Xcode and make and likely corrupt your build directory.

When you click clean in Xcode it will not perform an external build clean. Basically HandBrakeCLI and HandBrake.app are the only products which have full Xcode iterative development flexibility.

Each configuration uses a different build directory. This makes it possible to build each configuration and switch between them without losing their respective build state. The description of each configuration and the name convention for build directories are as follows:

standard
     This configuration will build to the host native architecture. Build directory is build.standard . The standard variant produces optimized code without debug information.

debug
     This configuration will build to the host native architecture. Build directory is build.standard . The debug variant produces unoptimized code with debug information.

standard.i386
     This configuration is used to build for the i386 architecture. Build directory is build.standard.i386 .

standard.x86_64
     This configuration is used to build for the x86_64 architecture. Build directory is build.standard.x86_64 .

standard.ppc
     This configuration is used to build for the ppc architecture. Build directory is build.standard.ppc .

standard.ppc64
     This configuration is used to build for the ppc64 architecture. Build directory is build.standard.ppc64 .

User-Defined Settings
=====================

The following user defined settings are used in Xcode project for the external build system:

EXTERNAL_BUILD
     Specifies the build location for each configuration. It is highly recommended the locations always evaluate to a unique pathname when factoring the configuration name.

EXTERNAL_JOBS
     Specifies the concurrency factor for the external build system when builds are launched from within Xcode. This variable is meant to be customized by the developer for faster builds if the host supports it.

EXTERNAL_METHOD
     This variable is used for internal/external build coordination and must always be xcode.

EXTERNAL_PROJECT
     Specifies the directory which is top of source tree.