[clang][test] Don't write temporary (actually, unused) outputs into CWD
[llvm-project.git] / .ci / monolithic-linux.sh
blob9054d70e3b01380a8a56d176499b02ba1ece5999
1 #!/usr/bin/env bash
2 #===----------------------------------------------------------------------===##
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #===----------------------------------------------------------------------===##
11 # This script performs a monolithic build of the monorepo and runs the tests of
12 # most projects on Linux. This should be replaced by per-project scripts that
13 # run only the relevant tests.
16 set -ex
17 set -o pipefail
19 MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
20 BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/monolithic-linux}"
22 rm -rf ${BUILD_DIR}
24 ccache --zero-stats
25 ccache --show-config
26 function show-stats {
27 ccache --print-stats
29 trap show-stats EXIT
31 projects="${1}"
32 targets="${2}"
34 echo "--- cmake"
35 pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
36 cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
37 -D LLVM_ENABLE_PROJECTS="${projects}" \
38 -G Ninja \
39 -D CMAKE_BUILD_TYPE=Release \
40 -D LLVM_ENABLE_ASSERTIONS=ON \
41 -D LLVM_BUILD_EXAMPLES=ON \
42 -D COMPILER_RT_BUILD_LIBFUZZER=OFF \
43 -D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml" \
44 -D LLVM_ENABLE_LLD=ON \
45 -D CMAKE_CXX_FLAGS=-gmlt \
46 -D BOLT_CLANG_EXE=/usr/bin/clang \
47 -D LLVM_CCACHE_BUILD=ON
49 echo "--- ninja"
50 ninja -C ${BUILD_DIR} ${targets}