Browse Source

Platform: updated grossly outdated iOS/Android/Emscripten docs.

pull/217/head
Vladimír Vondruš 9 years ago
parent
commit
d2f8e3bc9e
  1. 13
      src/Magnum/Platform/AndroidApplication.h
  2. 25
      src/Magnum/Platform/Sdl2Application.h

13
src/Magnum/Platform/AndroidApplication.h

@ -83,16 +83,19 @@ targets can be obtained by calling `android list target`.
android update project -p . -t "android-19" android update project -p . -t "android-19"
Then create build directories for ARM and x86 and run `cmake` and build command Then create build directories for ARM and x86 and run `cmake` and build command
in them. The toolchains need access to the platform file, so be sure to in them. Set `CMAKE_PREFIX_PATH` to the directory where you have all the
properly set **absolute** path to `toolchains/modules/` directory containing dependencies.
`Platform/Android.cmake`.
mkdir build-android-arm && cd build-android-arm mkdir build-android-arm && cd build-android-arm
cmake .. -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-ARM.cmake" cmake .. \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-ARM.cmake" \
-DCMAKE_PREFIX_PATH=/opt/android-ndk/platforms/android-19/arch-arm/usr
cmake --build . cmake --build .
mkdir build-android-x86 && cd build-android-x86 mkdir build-android-x86 && cd build-android-x86
cmake .. -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-x86.cmake" cmake .. \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-x86.cmake" \
-DCMAKE_PREFIX_PATH=/opt/android-ndk/platforms/android-19/arch-x86/usr
cmake --build . cmake --build .
See @ref cmake for more information. See @ref cmake for more information.

25
src/Magnum/Platform/Sdl2Application.h

@ -92,25 +92,28 @@ or [zip](https://github.com/mosra/magnum-bootstrap/archive/base-emscripten.zip)
file. After extracting the downloaded archive, you can do the desktop build in file. After extracting the downloaded archive, you can do the desktop build in
the same way as above. For the Emscripten build you also need to put the the same way as above. For the Emscripten build you also need to put the
contents of toolchains repository from https://github.com/mosra/toolchains contents of toolchains repository from https://github.com/mosra/toolchains
in `toolchains/` subdirectory. Don't forget to adapt `EMSCRIPTEN_PREFIX` in `toolchains/` subdirectory. There are two toolchain files. The
variable in `toolchains/generic/Emscripten.cmake` to path where Emscripten is `generic/Emscripten.cmake` is for the classical (asm.js) build, the
installed. Default is `/usr/emscripten`. `generic/Emscripten-wasm.cmake` is for WebAssembly build. Don't forget to adapt
`EMSCRIPTEN_PREFIX` variable in `toolchains/generic/Emscripten*.cmake` to path
where Emscripten is installed; you can also pass it explicitly on command-line
using `-DEMSCRIPTEN_PREFIX`. Default is `/usr/emscripten`.
Then create build directory and run `cmake` and build/install commands in it. Then create build directory and run `cmake` and build/install commands in it.
The toolchain needs access to its platform file, so be sure to properly set **absolute** Set `CMAKE_PREFIX_PATH` to where you have all the dependencies installed, set
path to `toolchains/modules/` directory containing `Platform/Emscripten.cmake`. `CMAKE_INSTALL_PREFIX` to have the files installed in proper location (a
Set `CMAKE_INSTALL_PREFIX` to have the files installed in proper location (a
webserver, e.g. `/srv/http/emscripten`). webserver, e.g. `/srv/http/emscripten`).
mkdir build-emscripten && cd build-emscripten mkdir build-emscripten && cd build-emscripten
cmake .. \ cmake .. \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \
-DCMAKE_PREFIX_PATH=/usr/lib/emscripten/system \
-DCMAKE_INSTALL_PREFIX=/srv/http/emscripten -DCMAKE_INSTALL_PREFIX=/srv/http/emscripten
cmake --build . cmake --build .
cmake --build . --target install cmake --build . --target install
You can then open `MyApplication.html` in Chrome or Firefox (through webserver, You can then open `MyApplication.html` in your browser (through webserver, e.g.
e.g. `http://localhost/emscripten/MyApplication.html`). `http://localhost/emscripten/MyApplication.html`).
## Bootstrap application for iOS ## Bootstrap application for iOS
@ -126,9 +129,7 @@ subdirectory.
Then create build directory and run `cmake` to generate the Xcode project. Set Then create build directory and run `cmake` to generate the Xcode project. Set
`CMAKE_OSX_ROOT` to SDK you want to target and enable all desired architectures `CMAKE_OSX_ROOT` to SDK you want to target and enable all desired architectures
in `CMAKE_OSX_ARCHITECTURES`. The toolchain needs access to its platform file, in `CMAKE_OSX_ARCHITECTURES`. Set `CMAKE_PREFIX_PATH` to the directory where
so be sure to properly set **absolute** path to `toolchains/modules/` directory
containing `Platform/iOS.cmake`. Set `CMAKE_PREFIX_PATH` to the directory where
you have all the dependencies. you have all the dependencies.
mkdir build-ios && cd build-ios mkdir build-ios && cd build-ios

Loading…
Cancel
Save