3 export SCRIPT_BASE
=$
(dirname `readlink -f $0`)
4 export BASE
=${SCRIPT_BASE}/..
5 export BUILD
=${BASE}/build
30 supported_build_types
=("Debug" "Release")
34 export NUM_PROC
=${NUM_PROC:-$(nproc --ignore=2)}
45 --volume $
(pwd):$
(pwd) \
48 --user $
(id
-u):$
(id
-g) \
57 dockerid
=${account}${name}:${compiler}
58 builddir
=${BUILD_DIR:-${BUILD}/$(echo "${dockerid}_${build_type}" | tr '/:' '__')}
60 if [ ! -d ${builddir} ] ; then
64 docker_run
${dockerid} "cmake -B ${builddir} -DCMAKE_BUILD_TYPE=${build_type} ${BASE}"
65 docker_run ${dockerid} "cmake --build ${builddir} -j ${NUM_PROC}"
66 docker_run
${dockerid} "cmake --build ${builddir} --target unittest"
67 docker_run
${dockerid} "cmake --build ${builddir} --target test"
72 echo "usage: $(basename $0) compiler build-type"
74 echo " supported compilers:"
75 for v
in ${supported_compilers[@]} ; do
79 echo " supported build types:"
80 for v
in ${supported_build_types[@]} ; do
86 function check_supported_compilers
()
89 for v
in ${supported_compilers[@]} ; do
90 if [ "${v}" == "${compiler}" ] ; then
94 echo "error: specified compiler not supported: ${compiler}"
98 function check_supported_build_types
()
101 for v
in ${supported_build_types[@]} ; do
102 if [ "${v}" == "${build_type}" ] ; then
106 echo "error: specified build type not supported: ${build_type}"
110 if [ $# -ne 2 ] ; then
115 check_supported_compilers
$1
116 check_supported_build_types
$2