[Driver] Add the --gcc-triple option (#73214)
[llvm-project.git] / .ci / monolithic-linux.sh
blobf0577d1069d5dec5e89950b72a5fd8908a5bcb1b
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}"
21 rm -rf ${BUILD_DIR}
23 ccache --zero-stats
25 if [[ -n "${CLEAR_CACHE:-}" ]]; then
26 echo "clearing cache"
27 ccache --clear
30 function show-stats {
31 mkdir -p artifacts
32 ccache --print-stats > artifacts/ccache_stats.txt
34 trap show-stats EXIT
36 projects="${1}"
37 targets="${2}"
39 echo "--- cmake"
40 pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
41 cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
42 -D LLVM_ENABLE_PROJECTS="${projects}" \
43 -G Ninja \
44 -D CMAKE_BUILD_TYPE=Release \
45 -D LLVM_ENABLE_ASSERTIONS=ON \
46 -D LLVM_BUILD_EXAMPLES=ON \
47 -D COMPILER_RT_BUILD_LIBFUZZER=OFF \
48 -D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml" \
49 -D LLVM_ENABLE_LLD=ON \
50 -D CMAKE_CXX_FLAGS=-gmlt \
51 -D BOLT_CLANG_EXE=/usr/bin/clang \
52 -D LLVM_CCACHE_BUILD=ON \
53 -D MLIR_ENABLE_BINDINGS_PYTHON=ON
55 echo "--- ninja"
56 # Targets are not escaped as they are passed as separate arguments.
57 ninja -C "${BUILD_DIR}" ${targets}