Skip to content

Commit a338ee1

Browse files
committed
wip
1 parent 0319fa0 commit a338ee1

File tree

4 files changed

+65
-9
lines changed

4 files changed

+65
-9
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ jobs:
116116
-DCMAKE_PREFIX_PATH=$PREFIX \
117117
-DCMAKE_INSTALL_PREFIX=$PREFIX \
118118
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
119+
-Dtabulate_DIR=$PREFIX/lib/cmake/tabulate \
120+
-DXSQL_BUILD_XSQLITE_EXECUTABLE=OFF \
121+
-DXSQL_BUILD_SHARED=OFF \
122+
-DXSQL_BUILD_STATIC=ON \
123+
-DXSQL_USE_SHARED_XEUS=ON \
124+
-DXSQL_USE_SHARED_XEUS_SQLITE=OFF \
125+
-DXVEGA_STATIC_LIBRARY=$PREFIX/lib/libxvega.a \
126+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
127+
119128
..
120129
121130
make -j${{ steps.cpu-cores.outputs.count }} install

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ if(EMSCRIPTEN)
6565
# for the emscripten build we need a FindSQLite3.cmake since
6666
# we install sqlite in a non-standart way
6767
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_emscripten;${CMAKE_MODULE_PATH}")
68+
69+
# overwriteProp.cmake
70+
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) # does not need to be global :)
71+
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1")
72+
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1")
73+
6874
endif()
6975

7076
# Dependencies
@@ -252,7 +258,7 @@ endif ()
252258
# xsqlite
253259
# =======
254260

255-
if (XSQL_BUILD_XSQLITE_EXECUTABLE)
261+
if (XSQL_BUILD_XSQLITE_EXECUTABLE AND NOT EMSCRIPTEN)
256262
find_package(xeus-zmq 1.1.1 REQUIRED)
257263
add_executable(xsqlite ${XSQLITE_SRC})
258264
set_target_properties(xsqlite PROPERTIES ENABLE_EXPORTS 1)

build.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
4+
# this is a helper script for local wasm builds.
5+
# we assume that script is run in the
6+
# env defined in environment-wasm-build.yml
7+
8+
set -e
9+
10+
# flip this to true to create the environments
11+
if false; then
12+
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32 --yes
13+
14+
else
15+
echo "Skipping environment creation"
16+
fi
17+
18+
mkdir -p build
19+
pushd build
20+
21+
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-sqlite-wasm-host
22+
export CMAKE_PREFIX_PATH=$PREFIX
23+
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
24+
25+
emcmake cmake \
26+
-DCMAKE_BUILD_TYPE=Release \
27+
-DCMAKE_PREFIX_PATH=$PREFIX \
28+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
29+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
30+
-Dtabulate_DIR=$PREFIX/lib/cmake/tabulate \
31+
-DXSQL_BUILD_XSQLITE_EXECUTABLE=OFF \
32+
-DXSQL_BUILD_SHARED=OFF \
33+
-DXSQL_BUILD_STATIC=ON \
34+
-DXSQL_USE_SHARED_XEUS=ON \
35+
-DXSQL_USE_SHARED_XEUS_SQLITE=OFF \
36+
-DXVEGA_STATIC_LIBRARY=$PREFIX/lib/libxvega.a \
37+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
38+
..
39+
40+
make -j2 install

environment-wasm-host.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ channels:
33
- https://repo.prefix.dev/emscripten-forge-dev
44
- https://repo.mamba.pm/conda-forge
55
dependencies:
6-
- nlohmann_json
7-
- sqlite
6+
- nlohmann_json >= 3.12
7+
- nlohmann_json-abi
8+
- xproperty
9+
- cpp-tabulate
10+
- xvega
11+
- xvega-bindings
12+
- xeus-lite
13+
- xeus
14+
- xtl
815
- sqlitecpp
9-
- cpp-tabulate=1.5
10-
- xvega>=0.1.3
11-
- xproperty>=0.12.1
12-
- xvega-bindings>=0.1.1
13-
- xeus-lite >= 4.0.0
14-
- xeus >= 2.4.0

0 commit comments

Comments
 (0)