-
Notifications
You must be signed in to change notification settings - Fork 14
Home
Welcome to the swig-v8 wiki!
> git clone git://github.com/oliver----/swig-v8.git
> cd swig-v8
> ./autogen.sh
> ./configure
> make
To set a default js engine for examples and test-suite:
> ./configure JSDEFAULT=jsc
or
> ./configure JSDEFAULT=v8
To get a debuggable version you have to run make commands this way:
> make CFLAGS="-g -O0" CXXFLAGS="-g -O0" <target>
You have to build the javascript interpreter, only once
> cd Examples
> make javascript_exe
To run an example:
> cd Examples/javascript/class
> make check
You can override the default engine here, e.g.,
> make V8=1 check
(run from root source directory)
> make check-javascript-test-suite
Again, argument V8=1 or JSC=1 will override the default engine.
To use swig for your custom projects you can use a pre-install executable within the source root
preinst-swig -javascript -jsc <-c++> ...
or for JSC
preinst-swig -javascript -v8 <-c++> ...
This takes the Lib files from the source directory. preinst-swig is not debuggable. For that you need to run the (debuggable version) of swig executable built into root of source tree. Here you have to specify manually where to find the swig library folder
> swig -I<path-to-swig-v8>/Lib -I<path-to-swig-v8>/Lib/javascript/v8 -javascript -v8 <-c++> ...
or for JSC:
> swig -I<path-to-swig-v8>/Lib -I<path-to-swig-v8>/Lib/javascript/jsc -javascript -jsc <-c++> ...