nim-leveldb/build.sh

32 lines
919 B
Bash
Raw Normal View History

2024-05-09 08:18:06 +00:00
#!/bin/bash
root=$(dirname "$0")
# install nimterop, if not already installed
if ! [ -x "$(command -v toast)" ]; then
nimble install -y nimterop@0.6.13
fi
2024-05-09 09:01:21 +00:00
cmake -S "${root}/sources" -B "${root}/build"
# prelude: not needed?
echo >> "${root}/leveldb.nim"
# assemble files to be compiled:
extensions="c cc cpp"
for ext in ${extensions}; do
echo ${ext}
for file in `find "${root}/sources" -type f -name "*.${ext}"`; do
echo ${file}
done
done
2024-05-09 08:18:06 +00:00
# generate nim wrapper with nimterop
2024-05-09 09:01:21 +00:00
#toast \
# --compile="${root}/sources/randombytes.c" \
# --compile="${root}/sources/hazmat.c" \
# --pnim \
# --noHeader \
# "${root}/sources/randombytes.h" \
# "${root}/sources/hazmat.h" > "${root}/sss/cwrapper.nim"
~ ~ ~