• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (c) 2021 Huawei Device Co., Ltd.
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15set -ex
16
17if [[ "${BUILD_TOOL}" = "ninja" ]]; then
18    GENERATOR="Ninja"
19    BUILD_STR="ninja -k1"
20else
21    GENERATOR="Unix Makefiles"
22    BUILD_STR="make"
23fi
24
25ccache --zero-stats || true
26ccache --show-stats || true
27
28mkdir -p $ARTIFACTS_DIR/out && cd $ARTIFACTS_DIR/out
29
30cmake $ROOT_DIR \
31      -G"${GENERATOR}" \
32      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
33      -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
34      -DPANDA_ENABLE_CLANG_TIDY=false \
35      ${CMAKE_OPTIONS};
36
37${BUILD_STR} -j${NPROC_PER_JOB} ${BUILD_TARGETS}
38
39ccache --show-stats || true
40