diff --git a/.circleci/config.yml b/.circleci/config.yml
index 5ac68236..ab832e39 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -2,22 +2,52 @@ version: 2
jobs:
- test:
- working_directory: ~/tgst
+ android-test:
+ working_directory: ~/winit
docker:
- image: tomaka/cargo-apk
steps:
- checkout
- restore_cache:
- key: test-cache-{{ checksum "Cargo.toml" }}
+ key: android-test-cache-{{ checksum "Cargo.toml" }}
- run: cargo apk build --example window
- save_cache:
- key: test-cache-{{ checksum "Cargo.toml" }}
+ key: android-test-cache-{{ checksum "Cargo.toml" }}
paths:
- target
+ asmjs-test:
+ working_directory: ~/winit
+ docker:
+ - image: tomaka/rustc-emscripten
+ steps:
+ - checkout
+ - restore_cache:
+ key: asmjs-test-cache-{{ checksum "Cargo.toml" }}
+ - run: cargo build --example window --target asmjs-unknown-emscripten
+ - save_cache:
+ key: asmjs-test-cache-{{ checksum "Cargo.toml" }}
+ paths:
+ - target
+
+ wasm-test:
+ working_directory: ~/winit
+ docker:
+ - image: tomaka/rustc-emscripten
+ steps:
+ - checkout
+ - restore_cache:
+ key: wasm-test-cache-{{ checksum "Cargo.toml" }}
+ - run: cargo build --example window --target wasm32-unknown-emscripten
+ - save_cache:
+ key: wasm-test-cache-{{ checksum "Cargo.toml" }}
+ paths:
+ - target
+
workflows:
version: 2
build-test-and-deploy:
jobs:
- - test
+ - android-test
+ - asmjs-test
+ - wasm-test
diff --git a/README.md b/README.md
index 3e82f258..6d2ea68f 100644
--- a/README.md
+++ b/README.md
@@ -41,3 +41,15 @@ fn main() {
});
}
```
+
+### Platform-specific usage
+
+#### Emscripten and WebAssembly
+
+Building a binary will yield a `.js` file. In order to use it in an HTML file, you need to:
+
+- Put a `` element somewhere. A canvas corresponds to a winit "window".
+- Write a Javascript code that creates a global variable named `Module`. Set `Module.canvas` to
+ the ID of the `