Building the Viewer with Autobuild

From Second Life Wiki
Jump to navigation Jump to search


Install autobuild

KBwarning.png Warning: If you are building for Windows go here Viewer_2_Microsoft_Windows_Builds and do not follow these instructions.

If you haven't done so already, install autobuild. Full documentation can be found on the Autobuild page. Quick installation instructions:

  • CD to where you want to install autobuild. Do not have any spaces in the path to this directory.
  • Do:
hg clone http://hg.secondlife.com/autobuild
  • Modify your path statement to include the autobuild /bin directory

Build a desired configuration

With a properly configured developer machine (see compiling), building the viewer with autobuild is as simple as invoking

 autobuild build -c [CONFIGURATION]

where CONFIGURATION stands for the build configuration you would like to build. The build configurations defined in the viewer's autobuild.xml file follow some simple conventions which we describe below. As a developer you should choose the appropriate build configuration for your needs. After a build has completed, the resulting product will be found in the build directory named build-* where the * is wildcard representing the platform dependent part of the name.

Developers who wish to build a viewer with an IDE don't have to do a full command line build. Using

 autobuild configure -c [CONFIGURATION]

Will install any dependencies (if the build configuration uses them) and construct an appropriate project or solution file (.xcodeproj for mac and .sln for windows) inside the build directory.

Linden build configurations

There are three basic types of build configurations which are used to vary the debugability of the resulting build versus optimization. These configurations are:

  • Debug — unoptimized with debugging information.
  • RelWithDebInfo — optimized but with debugging information.
  • Release — optimized with no debug information.

Debug will result in a slow client but is the easiest to use with a debugger. RelWithDebInfo is significantly faster and is often easy to debug, but code optimizations may occasionally make tracking program flow in a debugger challenging. Release is used for building a shipping version of the viewer.

Build variations for open source developers

Use only publicly distributed installables

The unmodified build configurations defined in the previous section are configured for use by Linden developers and may require access to installables which are not publicly available. For open source developers a variation is provided to support development by third parties using the following postfix:

  • OS — build a viewer using only publicly distributed installables.

To build an open source configuration choose one of the base configurations above and append OS to its name. For example, to build a viewer with release optimization including debug information run

autobuild build -c RelWithDebInfoOS

Note that there might still be issues with FMOD in the *OS builds. One possible fix is to explicitly disable the improper download of FMOD using

autobuild build  -c ReleaseOS -- -DFMOD:BOOL=FALSE
Use no installables
KBwarning.png Warning: Building with system libraries rather than autobuild installables is not officially supported. Thus, it is not tested routinely and might be broken any time.

It is possible to build the viewer only using libraries installed to your system, rather than installing Linden Lab-supplied installables into the source tree checkout. For historic reasons, this is known as a "STANDALONE" build. (See What does 'Standalone' mean? on the Linux specific build instructions page.)

KBnote.png Note: "STANDALONE" is to be renamed to "USE_INSTALLED_LIBS". See OPEN-11.
KBcaution.png Important: To build "STANDALONE", you have to install any 3rd party dependencies manually.

There are no separate build configurations for STANDALONE. Instead, you may use the *OS configurations and manually switch the STANDALONE CMake variable to ON. For example, to build a viewer with release optimization including debug information run

autobuild configure -c RelWithDebInfoOS -- -DSTANDALONE=ON
autobuild build -c RelWithDebInfoOS --no-configure

Custom builds

If none of the predefined build configurations matches your needs, you have two options for building with exactly the options you need. If you just need to pass an extra configuration option, you should first run the configure command with the following syntax

 autobuild configure -c [build configuration] -- [Option, [Option...]]

Options which appear after the -- are passed through to the configuration command. Now you may build using

 autobuild build -c [build configuration] --no-configure -- [Option, [Option]]

passing any options that should be forwarded to the build command after the --. Using the --no-configure option prevents the configure step from being run again (potentially reverting any option you passed) during the build step.

Alternatively you may add a new configuration to the autobuild.xml configuration file using

 autobuild edit configure

and

 autobuild edit  build

to interactively create new configure and build configurations. More information on creating these configurations may be found in the Autobuild_How_To page.