diff --git a/doc/building.dox b/doc/building.dox index 53d3e6b24..8d122190c 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -5,7 +5,8 @@ namespace Magnum { %Magnum can be downloaded from GitHub and built either @ref building-compilation "manually" or using already prepared packaging files, currently only @ref building-arch "ArchLinux PKGBUILDs". Guide how to -@ref building-win "crosscompile for Windows" is also available. +crosscompile for @ref building-win "Windows" and +@ref building-nacl "Google Chrome Native Client" is also available. @tableofcontents @@ -151,5 +152,49 @@ cmake and make. You may need to modify the `basic-mingw32.cmake` file and Then you can install the package using `make install` to make it available for depending projects. + +@section building-nacl Compiling for Google Chrome Native Client + +You will need [Native Client SDK](https://developers.google.com/native-client/beta/sdk/download). +Tested version is `pepper_22`. + +Make sure you have `toolchains` Git submodule updated, as +@ref building-download "explained above". Don't forget to adapt `NACL_PREFIX +variable in `generic/NaCl-glibc-x86-32.cmake` and `generic/NaCl-glibc-x86-64.cmake` +to path where your SDK is installed. Default is `/usr/nacl`. + +Then create build directories for x86-32 and x86-64 and run cmake and make in +them. The toolchains needs access to its platform file, so be sure to properly +set **absolute** path to `modules/` directory containing `Platform/NaCl.cmake`. +Also adapt `CMAKE_INSTALL_PREFIX` to the same value you entered into toolchain +files above. + + mkdir -p build-nacl-x86-32 + cd build-nacl-x86-32 + cmake .. \ + -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ + -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-glibc-x86-32.cmake" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/nacl \ + -DWITH_NACLAPPLICATION=ON \ + -DLIB_SUFFIX=/32 + make + + mkdir -p build-nacl-x86-64 + cd build-nacl-x86-64 + cmake .. \ + -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ + -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-glibc-x86-64.cmake" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/nacl \ + -DWITH_NACLAPPLICATION=ON + make + +Then you can install both versions using `make install` to make them available +for depending projects. The headers are shared by both versions. + +For ArchLinux there is also prepared package file in root, named +`PKGBUILD-nacl`. + */ }