sets up prelude
This commit is contained in:
parent
90f998333a
commit
432ffc2152
20
build.sh
20
build.sh
|
@ -16,21 +16,18 @@ rm -Rf "${root}/sources/third_party"
|
||||||
rm -Rf "${root}/sources/benchmarks"
|
rm -Rf "${root}/sources/benchmarks"
|
||||||
rm "${root}/sources/util/testutil.cc"
|
rm "${root}/sources/util/testutil.cc"
|
||||||
|
|
||||||
# prelude: not needed?
|
# Prelude:
|
||||||
|
cat "${root}/prelude.nim" > "${root}/leveldb.nim"
|
||||||
rm "${root}/leveldb.nim"
|
|
||||||
echo >> "${root}/leveldb.nim"
|
echo >> "${root}/leveldb.nim"
|
||||||
|
|
||||||
# assemble files to be compiled:
|
# assemble files to be compiled:
|
||||||
extensions="c cc cpp"
|
extensions="c cc cpp"
|
||||||
for ext in ${extensions}; do
|
for ext in ${extensions}; do
|
||||||
for file in `find "${root}/sources" -type f -name "*.${ext}"`; do
|
for file in `find "${root}/sources" -type f -name "*.${ext}" \
|
||||||
if [[ $file == *"_test"* ]]; then
|
| grep -v "_test" \
|
||||||
echo "Skip test file: ${file}"
|
| grep -v "env_windows.cc" \
|
||||||
else
|
| grep -v "env_posix.cc"`; do
|
||||||
echo "Include file: ${file}"
|
compile="${compile} --compile=${file}"
|
||||||
compile="${compile} --compile=${file}"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -46,5 +43,6 @@ toast \
|
||||||
--includeDirs="${root}/sources/port" \
|
--includeDirs="${root}/sources/port" \
|
||||||
--includeDirs="${root}/sources/include" \
|
--includeDirs="${root}/sources/include" \
|
||||||
--includeDirs="${root}/build/include" \
|
--includeDirs="${root}/build/include" \
|
||||||
|
--includeDirs="${root}/build/include/port" \
|
||||||
"${root}/sources/include/leveldb/c.h" >> "${root}/leveldb.nim"
|
"${root}/sources/include/leveldb/c.h" >> "${root}/leveldb.nim"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
when defined(windows):
|
||||||
|
{.compile: "./sources/util/env_windows.cc".}
|
||||||
|
{.passc: "-DLEVELDB_PLATFORM_POSIX".}
|
||||||
|
|
||||||
|
when defined(posix):
|
||||||
|
{.compile: "./sources/util/env_posix.cc".}
|
||||||
|
{.passc: "-DLEVELDB_PLATFORM_WINDOWS".}
|
Loading…
Reference in New Issue