nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

initbuild.sh (968B)


      1 #!/bin/sh
      2 
      3 # link a specific build.cfg.xxx to build.cfg to use that build
      4 # configuration, e.g. ln -sf build.cfg.make build.cfg
      5 #
      6 # call build/cleanall.sh before changing
      7 
      8 set -e
      9 
     10 HERE=`dirname $0`
     11 cd $HERE/..
     12 ROOT=`pwd`
     13 
     14 CFGFILE=${ROOT}/scripts/build.cfg
     15 
     16 if [ x"$1" != x ]; then
     17     if [ -e ${CFGFILE}.$1 ]; then
     18         ln -sf ${CFGFILE}.$1 $CFGFILE
     19     else
     20         echo "missing config file for build generator option: $1"
     21         exit -1
     22     fi
     23     ${ROOT}/scripts/cleanall.sh
     24 fi
     25 
     26 if [ -e $CFGFILE ]; then
     27     . $CFGFILE
     28 fi
     29 
     30 FLATCC_BUILD_GEN=${FLATCC_BUILD_GEN:-Ninja}
     31 
     32 echo "initializing build for CMake $FLATCC_BUILD_GEN"
     33 
     34 mkdir -p ${ROOT}/build/Debug
     35 mkdir -p ${ROOT}/build/Release
     36 rm -rf ${ROOT}/build/Debug/*
     37 rm -rf ${ROOT}/build/Release/*
     38 
     39 cd ${ROOT}/build/Debug && cmake -G "$FLATCC_BUILD_GEN" $FLATCC_BUILD_FLAGS ../.. -DCMAKE_BUILD_TYPE=Debug
     40 cd ${ROOT}/build/Release && cmake -G "$FLATCC_BUILD_GEN" $FLATCC_BUILD_FLAGS ../.. -DCMAKE_BUILD_TYPE=Release