File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -ex
4+
5+ BASE_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} /" ) /.." & > /dev/null && pwd )
6+
7+ AWS_LC_BUILD=" ${BASE_DIR} /build"
8+
9+ DEFAULT_CMAKE_FLAGS=(" -DCMAKE_BUILD_TYPE=Debug" " -GNinja" )
10+
11+ BUILD_TARGET=" all_tests"
12+ RUN_TARGET=" run_tests"
13+ BUILD_ONLY=false
14+ CMAKE_ARGS=()
15+
16+ while [[ $# -gt 0 ]]; do
17+ case " $1 " in
18+ --build-only)
19+ BUILD_ONLY=true
20+ shift
21+ ;;
22+ --build-target)
23+ BUILD_TARGET=" $2 "
24+ shift 2
25+ ;;
26+ --run-target)
27+ RUN_TARGET=" $2 "
28+ shift 2
29+ ;;
30+ * )
31+ # Everything else gets passed to CMake
32+ CMAKE_ARGS+=(" $1 " )
33+ shift
34+ ;;
35+ esac
36+ done
37+
38+ mkdir -p " ${AWS_LC_BUILD} "
39+
40+ cmake " ${BASE_DIR} " -B " ${AWS_LC_BUILD} " " ${DEFAULT_CMAKE_FLAGS[@]} " " ${CMAKE_ARGS[@]} "
41+
42+ cmake --build " ${AWS_LC_BUILD} " -j --target ${BUILD_TARGET}
43+
44+ # Only run tests if --build-only was not specified
45+ if [ " $BUILD_ONLY " = false ]; then
46+ cmake --build " ${AWS_LC_BUILD} " --target ${RUN_TARGET}
47+ fi
You can’t perform that action at this time.
0 commit comments