Build the Viewer on macOS

From Second Life Wiki
Revision as of 12:43, 4 March 2015 by Oz Linden (talk | contribs) (Created page with "{{Multi-lang}} {{CompileNav}} ==Getting Development Tools== ;Xcode 6.1 :download Xcode 6.1 from Apple, and install the developer command line tools ;CMake :Install CMake ver...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Getting Development Tools

Xcode 6.1
download Xcode 6.1 from Apple, and install the developer command line tools
Install CMake version 3.1 from
Install the current Mercurial from Selenic
If you may be contributing code back to the viewer, install the Mercurial Coding Policy hooks
Autobuild 1.0
Install the new version of autobuild as described on Autobuild Improvements

Downloading Source Code

The canonical repository is

KBnote.png Note: Because using the new tools required source code changes, these instructions do not work with the canonical viewer-release repository. Use

Installing Proprietary Libraries

Some builds of the the Viewer depends on proprietary libraries (alternative open source libraries are also provided for developers who prefer or are not licensed to use the proprietary libraries). Lindens do not distribute these libraries, so you will need to fetch and install these even if you download the libraries packages. (This is due to licensing restrictions. Don't ask, Lindens already did, and can't get permission. So you do have to get them yourself.)


Fmod method 1 (using autobuild)

CD to where you want to install the 3p-fmod repository and do:

$ hg clone
$ cd 3p-fmod
$ autobuild build --all
$ autobuild package

You will see the result looks like:

packing fmod
wrote  /3p-fmod/fmod-3.75-darwin-20120614.tar.bz2
md5    527422281dbe49abac29380996d41230

CD to your repository root and update autobuild configulation file with the filename and hash just displayed. For the example above, run:

$ autobuild installables edit fmod platform=darwin hash=527422281dbe49abac29380996d41230 url=file:///3p-fmod/fmod-3.75-darwin-20120614.tar.bz2

Note: FMOD does not host the appropriate version any longer. You will need from elsewhere; currently, Kittin Ninetails is hosting it on her SkyDrive.

Configuration and Building

Configuring your build with Autobuild

Configuring and building with autobuild works the same on all platforms. Full instructions may be found at Build_Viewer_With_Autobuild.


autobuild configure -c RelWithDebInfoOS -- -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE

Command Line Build

autobuild build --no-configure

you can omit the --no-configure option, if you do autobuild will implicitly run the configuration step

Building within Xcode

If you have followed the configure instructions from Build_Viewer_With_Autobuild, the directory build-darwin-i386 will have been created in the root of your source distribution. Inside that directory you will find the SecondLife.xcodeproj project file which can be used with Xcode. When opened it should be configured correctly to build, so just Build and Run.

Running your newly built viewer

Command Line

In your source tree root directory, run:

$build-darwin-i386/newview/configuration-type/Second\\ Life

where configuration-type depends on your built configuration ("DebugOS", "ReleaseOS" or "RelWithDebInfoOS").

Running within Xcode

"secondlife-bin" scheme is what you look for.

Using Finder

  1. Navigate to build-darwin-i386/newview/configuration-type.
  2. Double click the application.
You can create and put the alias wherever you find convenient.

Running the Unit Tests

From Xcode, open the project build-darwin-i386/test/test.xcodeproj and select "test" for scheme and run. SecondLife.xcodeproj project also has "test" scheme.

Handling Problems

If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already.

You may find the solution in any of these resources:

Getting Help

Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to get help.

Submitting Changes

This is probably far down the road, but if you make changes to the source and want to submit them, see the page about submitting patches.