-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·40 lines (32 loc) · 1.1 KB
/
autogen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/sh
set -ex
# Minor helper to avoid repeating myself,
# This shortcut allows you to simply invoke ../../autogen.sh when being
# in directories like:
# ./target/{Debug,RelWithDebInfo,Release}
if [ -e ../../autogen.sh ] && [ "x$1" == "x" ] &&
[ -x "$(command -v realpath)" ] &&
[ "$(basename $(realpath ${PWD}/..))" = "target" ]
then
exec ../../autogen.sh $(basename $(realpath ${PWD}))
fi
if [ -x "$(command -v realpath)" ]; then
ROOTDIR="$(realpath $(dirname $0))"
else
ROOTDIR="$(dirname $0)"
fi
CXX=${CXX="g++"}
CXX_NAME=$(basename $CXX)
BUILD_TYPE="${1:-Debug}"
BUILD_DIR="${ROOTDIR}/target/$(uname -m)-$(uname -s)-${CXX_NAME}-${BUILD_TYPE}"
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DLIBUNICODE_UCD_BASE_DIR=$ROOTDIR/_ucd"
echo "EXTRA_CMAKE_FLAGS: ${EXTRA_CMAKE_FLAGS}"
exec cmake "${ROOTDIR}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DPEDANTIC_COMPILER=ON \
-DPEDANTIC_COMPILER_WERROR=ON \
-DCMAKE_CXX_STANDARD=20 \
${EXTRA_CMAKE_FLAGS} \
-B "${BUILD_DIR}" \
-GNinja