From d2f8e3bc9e2e1f31c70834939055a0667794457a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 21 Aug 2017 11:55:14 +0200 Subject: [PATCH] Platform: updated grossly outdated iOS/Android/Emscripten docs. --- src/Magnum/Platform/AndroidApplication.h | 13 +++++++----- src/Magnum/Platform/Sdl2Application.h | 25 ++++++++++++------------ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/Magnum/Platform/AndroidApplication.h b/src/Magnum/Platform/AndroidApplication.h index 8289a012b..622d5c2a8 100644 --- a/src/Magnum/Platform/AndroidApplication.h +++ b/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" 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 -properly set **absolute** path to `toolchains/modules/` directory containing -`Platform/Android.cmake`. +in them. Set `CMAKE_PREFIX_PATH` to the directory where you have all the +dependencies. 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 . 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 . See @ref cmake for more information. diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 2d5219aff..97a468dbc 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/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 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 -in `toolchains/` subdirectory. Don't forget to adapt `EMSCRIPTEN_PREFIX` -variable in `toolchains/generic/Emscripten.cmake` to path where Emscripten is -installed. Default is `/usr/emscripten`. +in `toolchains/` subdirectory. There are two toolchain files. The +`generic/Emscripten.cmake` is for the classical (asm.js) build, the +`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. -The toolchain needs access to its platform file, so be sure to properly set **absolute** -path to `toolchains/modules/` directory containing `Platform/Emscripten.cmake`. -Set `CMAKE_INSTALL_PREFIX` to have the files installed in proper location (a +Set `CMAKE_PREFIX_PATH` to where you have all the dependencies installed, set +`CMAKE_INSTALL_PREFIX` to have the files installed in proper location (a webserver, e.g. `/srv/http/emscripten`). mkdir build-emscripten && cd build-emscripten 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 cmake --build . cmake --build . --target install -You can then open `MyApplication.html` in Chrome or Firefox (through webserver, -e.g. `http://localhost/emscripten/MyApplication.html`). +You can then open `MyApplication.html` in your browser (through webserver, e.g. +`http://localhost/emscripten/MyApplication.html`). ## Bootstrap application for iOS @@ -126,9 +129,7 @@ subdirectory. 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 -in `CMAKE_OSX_ARCHITECTURES`. The toolchain needs access to its platform file, -so be sure to properly set **absolute** path to `toolchains/modules/` directory -containing `Platform/iOS.cmake`. Set `CMAKE_PREFIX_PATH` to the directory where +in `CMAKE_OSX_ARCHITECTURES`. Set `CMAKE_PREFIX_PATH` to the directory where you have all the dependencies. mkdir build-ios && cd build-ios