Simplify compilations build helper
Instead of using ninja/make directly, there is a cmake command option to trigger the build using whatever build tool has been configured. Use it; if there is a mismatch, there will also be a clearer cmake error. Remove build_oai's --build-coverity: we don't use it, and it can trivially be added if required (probably, most users would run it by hand anyway). Add an error if the compilations function is not called with the right noumber of arguments.
This commit is contained in:
@@ -216,36 +216,26 @@ check_errors() {
|
||||
}
|
||||
|
||||
compilations() {
|
||||
[[ $# -gt 2 ]] || echo_fatal "compilations needs more than three arguments"
|
||||
local dir=$1
|
||||
shift 1
|
||||
local logfile=$1
|
||||
shift 1
|
||||
local targets=$@
|
||||
local verbose=$([ "$VERBOSE_COMPILE" == "1" ] && echo "-v" || echo "")
|
||||
echo cd $OPENAIR_DIR/cmake_targets/$dir/build
|
||||
cd $OPENAIR_DIR/cmake_targets/$dir/build
|
||||
cecho "Running \"$MAKE_CMD $targets\"" $green
|
||||
echo_info "Log file for compilation is being written to: $dlog/$logfile"
|
||||
echo_info "Running \"cmake --build . $verbose --target $targets -- -j$(nproc)\"" $green
|
||||
echo "Log file for compilation is being written to: $dlog/$logfile"
|
||||
set +e
|
||||
{
|
||||
if [ "$BUILD_COVERITY_SCAN" == "1" ]; then
|
||||
COV_SCAN_PREFIX="cov-build --dir cov-int"
|
||||
else
|
||||
COV_SCAN_PREFIX=""
|
||||
fi
|
||||
if [ "$MAKE_CMD" != "" ]; then
|
||||
$MAKE_CMD $targets
|
||||
else
|
||||
if [ "$VERBOSE_COMPILE" == "1" ]; then
|
||||
$COV_SCAN_PREFIX make -j`nproc` $targets VERBOSE=$VERBOSE_COMPILE
|
||||
else
|
||||
$COV_SCAN_PREFIX make -j`nproc` $targets
|
||||
fi
|
||||
fi
|
||||
cmake --build . $verbose --target $targets -- -j$(nproc)
|
||||
ret=$?
|
||||
} > $dlog/$logfile 2>&1
|
||||
if [ "$VERBOSE_CI" == "1" ]; then
|
||||
echo_info "====== Start of log for $logfile ======"
|
||||
echo "====== Start of log for $logfile ======"
|
||||
cat $dlog/$logfile
|
||||
echo_info "====== End of log for $logfile ======"
|
||||
echo "====== End of log for $logfile ======"
|
||||
fi
|
||||
check_warnings "$dlog/$logfile"
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user