compiling_for_osx.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. _doc_compiling_for_osx:
  2. Compiling for OSX
  3. =================
  4. .. highlight:: shell
  5. Requirements
  6. ------------
  7. For compiling under Linux or other Unix variants, the following is
  8. required:
  9. - Python 2.7+ (3.0 is untested as of now)
  10. - SCons build system
  11. - XCode
  12. Compiling
  13. ---------
  14. Start a terminal, go to the root dir of the engine source code and type:
  15. ::
  16. user@host:~/godot$ scons platform=osx
  17. If all goes well, the resulting binary executable will be placed in the
  18. "bin" subdirectory. This executable file contains the whole engine and
  19. runs without any dependencies. Executing it will bring up the project
  20. manager. There is a .app template to put the binary into in
  21. ``tools/Godot.app``.
  22. Cross-compiling
  23. ---------------
  24. It is possible to compile for OSX in a Linux environment (and maybe
  25. also in Windows with Cygwin). For that you will need
  26. `OSXCross <https://github.com/tpoechtrager/osxcross>`__ to be able
  27. to use OSX as target. First, follow the instructions to install it:
  28. Clone the `OSXCross repository <https://github.com/tpoechtrager/osxcross>`
  29. somewhere on your machine (or download a zip file and extract it somewhere),
  30. e.g.:
  31. ::
  32. user@host:~$ git clone https://github.com/tpoechtrager/osxcross.git /home/myuser/sources/osxcross
  33. 1. Follow the instructions to package the SDK:
  34. https://github.com/tpoechtrager/osxcross#packaging-the-sdk
  35. 2. Follow the instructions to install OSXCross:
  36. https://github.com/tpoechtrager/osxcross#installation
  37. After that, you will need to define the ``OSXCROSS_ROOT`` as the path to
  38. the OSXCross installation (the same place where you cloned the
  39. repository/extracted the zip), e.g.:
  40. ::
  41. user@host:~$ export OSXCROSS_ROOT=/home/myuser/sources/osxcross
  42. Now you can compile with SCons like you normally would:
  43. ::
  44. user@host:~/godot$ scons platform=osx
  45. If you have an OSXCross SDK version different from the one expected by the SCons buildsystem, you can specify a custom one with the ``osxcross_sdk`` argument:
  46. ::
  47. user@host:~/godot$ scons platform=osx osxcross_sdk=darwin15