301 | | * '''Note:''' As of Mavericks (10.9) and Xcode 5, Apple [https://developer.apple.com/library/mac/releasenotes/DeveloperTools/RN-Xcode/xc5_release_notes/xc5_release_notes.html#//apple_ref/doc/uid/TP40001051-CH2-SW302 no longer supports] llvm-gcc, instead it is required to use clang. Additionally, the default C++ library is now libc++ instead of libstdc++. |
302 | | * If you've upgraded and previously built the game, you should pass the `--force-rebuild` flag to `build-osx-libs.sh`. |
303 | | * '''Note:''' As of Alpha 16, the game uses SpiderMonkey 24, which no longer supports gcc 4.2.x including llvm-gcc previously bundled with Xcode. The game can no longer be built on OS X Leopard (10.5), and there is a !SpiderMonkey [https://bugzilla.mozilla.org/show_bug.cgi?id=862657 bug] that breaks the build on Snow Leopard (10.6) with Xcode 3.2.6. |
304 | | * '''Note: CMake is a required dependency.''' You can download a prebuilt OS X package [http://www.cmake.org/cmake/resources/software.html here]. If prompted, install the command line CMake tools to the default location. |
305 | | * Obtain the game's source code from SVN as [#Gettingthecode described above]. |
| 301 | * '''Note:''' As of Mavericks (10.9) and Xcode 5, Apple [https://developer.apple.com/library/mac/releasenotes/DeveloperTools/RN-Xcode/xc5_release_notes/xc5_release_notes.html#//apple_ref/doc/uid/TP40001051-CH2-SW302 no longer supports] llvm-gcc, instead it is required to use clang. Additionally, the default C++ library is now libc++ instead of libstdc++. If you've upgraded and previously built the game, you should pass the `--force-rebuild` flag to `build-osx-libs.sh`. |
| 302 | * '''Note:''' As of Alpha 16, the game uses SpiderMonkey 24, which no longer supports gcc 4.2.x including llvm-gcc previously bundled with Xcode. The game can no longer be built on OS X Leopard (10.5), and there is a !SpiderMonkey [https://bugzilla.mozilla.org/show_bug.cgi?id=862657 bug] that breaks the build on Snow Leopard (10.6) with Xcode 3.2.6. |
| 303 | * '''Note: CMake is a required dependency.''' You can download a prebuilt OS X package [http://www.cmake.org/cmake/resources/software.html here]. If prompted, install the command line CMake tools to the default location. |
| 304 | * Obtain the game's source code: |
| 305 | * 0 A.D. is primarily developed on SVN. To checkout the latest code from SVN, run this command: |
| 306 | {{{ |
| 307 | #!sh |
| 308 | svn co http://svn.wildfiregames.com/public/ps/trunk/ 0ad |
| 309 | }}} |
| 310 | '''Note:''' Sometimes SVN stops before it has downloaded all files. You should check that it outputs something like `at revision rXXXX`. Otherwise run |
| 311 | {{{ |
| 312 | #!sh |
| 313 | svn up 0ad |
| 314 | }}} |
| 315 | * There is also a Git mirror, which may be slightly less up-to-date but usually offers faster downloads. To use the Git mirror, use this command instead: |
| 316 | {{{ |
| 317 | #!sh |
| 318 | git clone https://github.com/0ad/0ad.git |
| 319 | }}} |
309 | | === 1. Build the game as a loose binary === |
310 | | |
311 | | * Run [source:/ps/trunk/libraries/osx/build-osx-libs.sh libraries/osx/build-osx-libs.sh], the OS X libraries build script, this will download and build the game's dependencies (except CMake, see above). |
| 323 | === 1. Build the game for your personal use === |
| 324 | |
| 325 | * Run [source:/ps/trunk/libraries/osx/build-osx-libs.sh libraries/osx/build-osx-libs.sh], the OS X libraries build script, this will download and build the game's dependencies (except CMake, see above). This script will take some time to finish when first run, after that it will reuse the old build. |
317 | | * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. |
318 | | * To build on the command line with `llvm-gcc`, follow the [#Build build] instructions for Linux beginning with `./update-workspaces.sh`. |
319 | | * Or if you have Xcode 4 installed, you can open `build/workspaces/xcode4/pyrogenesis.xcworkspace` (see discussion on this [http://www.wildfiregames.com/forum/index.php?showtopic=15511&st=160#entry261743 here]). |
320 | | * Or if you're on Snow Leopard and have Xcode 3 installed, you can open `build/workspaces/xcode3/pyrogenesis.xcodeproj` |
| 331 | * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. |
| 332 | * To force a rebuild for some reason, e.g. the SVN folder is moved or Xcode / OS X is upgraded, pass in the `--force-rebuild` flag. |
| 333 | * Next, to build the game on the command line, use the following commands: |
| 334 | {{{ |
| 335 | #!sh |
| 336 | cd 0ad/build/workspaces |
| 337 | ./update-workspaces.sh -j3 |
| 338 | cd gcc |
| 339 | make -j3 |
| 340 | }}} |
| 341 | * The '''Release''' mode builds (which are the default) are more optimised, but are harder to debug. Use `make config=debug` (and run `pyrogenesis_dbg`) if you need better debugging support. See [wiki:Debugging] for more details. |
| 342 | * If you encounter any build errors, review the [http://trac.wildfiregames.com/report existing bug reports], check the [#Knownproblemsandsolutions known problems section] or please file a [http://trac.wildfiregames.com/newticket new bug in the tracker]. |
| 343 | * Or if you have Xcode 4 installed, you can open `build/workspaces/xcode4/pyrogenesis.xcworkspace` (see discussion on this [http://www.wildfiregames.com/forum/index.php?showtopic=15511&st=160#entry261743 here]). |
| 344 | * Or if you're on Snow Leopard and have Xcode 3 installed, you can open `build/workspaces/xcode3/pyrogenesis.xcodeproj` |
326 | | * Open [source:/ps/trunk/build/workspaces/build-osx-bundle.sh build/workspaces/build-osx-bundle.sh] and read the comments. You might need to change a few settings depending on your version of OS X, Xcode, etc. |
327 | | * Run `build-osx-bundle.sh`: |
| 351 | * Open [source:/ps/trunk/build/workspaces/build-osx-bundle.sh build/workspaces/build-osx-bundle.sh] and read the comments. You will need to change a few settings depending on your version of OS X, Xcode, etc. |
| 352 | * Run `build-osx-bundle.sh`, the bundle build script, which will download and build the game's dependencies for the appropriate SDK, build the game's source code, package the mod data, and set up the app bundle info. |