diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-07-16 02:03:33 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-07-16 02:03:33 +0200 |
commit | b31e4bc16d1df62b50c6f77a77041f9e7b6c906d (patch) | |
tree | 024c74c13d918aa6bde302aab6836fa33607613c /flatcc/scripts/initbuild.sh | |
parent | ba6815ef8fb8ae472412b5af2837a7caba2799c2 (diff) | |
parent | 5a40295c4cf0af5ea8da9ced04a4ce7d3621a080 (diff) |
Merge commit '5a40295c4cf0af5ea8da9ced04a4ce7d3621a080' as 'flatcc'
Diffstat (limited to 'flatcc/scripts/initbuild.sh')
-rwxr-xr-x | flatcc/scripts/initbuild.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/flatcc/scripts/initbuild.sh b/flatcc/scripts/initbuild.sh new file mode 100755 index 0000000..2b18cd2 --- /dev/null +++ b/flatcc/scripts/initbuild.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# link a specific build.cfg.xxx to build.cfg to use that build +# configuration, e.g. ln -sf build.cfg.make build.cfg +# +# call build/cleanall.sh before changing + +set -e + +HERE=`dirname $0` +cd $HERE/.. +ROOT=`pwd` + +CFGFILE=${ROOT}/scripts/build.cfg + +if [ x"$1" != x ]; then + if [ -e ${CFGFILE}.$1 ]; then + ln -sf ${CFGFILE}.$1 $CFGFILE + else + echo "missing config file for build generator option: $1" + exit -1 + fi + ${ROOT}/scripts/cleanall.sh +fi + +if [ -e $CFGFILE ]; then + . $CFGFILE +fi + +FLATCC_BUILD_GEN=${FLATCC_BUILD_GEN:-Ninja} + +echo "initializing build for CMake $FLATCC_BUILD_GEN" + +mkdir -p ${ROOT}/build/Debug +mkdir -p ${ROOT}/build/Release +rm -rf ${ROOT}/build/Debug/* +rm -rf ${ROOT}/build/Release/* + +cd ${ROOT}/build/Debug && cmake -G "$FLATCC_BUILD_GEN" $FLATCC_BUILD_FLAGS ../.. -DCMAKE_BUILD_TYPE=Debug +cd ${ROOT}/build/Release && cmake -G "$FLATCC_BUILD_GEN" $FLATCC_BUILD_FLAGS ../.. -DCMAKE_BUILD_TYPE=Release |