forked from jupyter-xeus/xeus-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_wasm.cpp
30 lines (24 loc) · 1.15 KB
/
main_wasm.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/***************************************************************************
* Copyright (c) 2021, Thorsten Beier * *
* Copyright (c) 2021, QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#include <memory>
#include <emscripten/bind.h>
#include <pybind11/embed.h>
#include <pyjs/export_pyjs_module.hpp>
#include <pyjs/export_js_module.hpp>
#include "xeus/xembind.hpp"
#include "xeus-python/xinterpreter_wasm.hpp"
PYBIND11_EMBEDDED_MODULE(pyjs_core, m) {
pyjs::export_pyjs_module(m);
}
EMSCRIPTEN_BINDINGS(my_module) {
pyjs::export_js_module();
xeus::export_core();
using interpreter_type = xpyt::wasm_interpreter;
xeus::export_kernel<interpreter_type>("xkernel");
}