-
Notifications
You must be signed in to change notification settings - Fork 53
Getting Started
Clone this repo using git.
git clone [email protected]:google/pepper.js.git
Install the NaCl
SDK. Set the
NACL_SDK_ROOT
environment variable to be an absolute path that
points to the desired pepper_*
directory inside of the NaCl SDK. For
example, to temporarily set the environment variable:
set NACL_SDK_ROOT=c:\path\to\nacl_sdk\pepper_31 (Windows)
export NACL_SDK_ROOT=/path/to/nacl_sdk/pepper_31 (Almost everything else)
Install the Emscripten SDK.
Emscripten expects a python2
binary to exist. If it does not exist on
your system, such as on OSX, you can create a symlink.
sudo ln -s /usr/bin/python /usr/bin/python2
cd examples
make TOOLCHAIN=emscripten CONFIG=Debug
make TOOLCHAIN=emscripten CONFIG=Release
make TOOLCHAIN=pnacl CONFIG=Debug
make TOOLCHAIN=pnacl CONFIG=Release
When you run Emscripten for the first time, it will build a few
dependencies in the background and the compilation may appear to hang.
Emscripten will also create a create a configuration file named
~/.emscripten
. You may need to edit this file if it fails to guess the
correct paths, or you want to use a version other than the one it
guessed.
cd .. (out of the examples directory)
python ./tools/httpd.py
Surf to http://127.0.0.1:5103/examples/examples.html. Note that this web server can be accessed remotely, for better and for worse.
Note that to run the NaCl examples you'll need to pass --enable-nacl
to Chrome on the command line or enable it in about:flags
.