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 Windows. This should be replaced by per-project scripts that
13 # run only the relevant tests.
19 MONOREPO_ROOT
="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
20 BUILD_DIR
="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
24 if [[ -n "${CLEAR_CACHE:-}" ]]; then
25 echo "clearing sccache"
32 sccache
--show-stats >> artifacts
/sccache_stats.txt
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}" \
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 --timeout=1200 --time-tests" \
49 -D COMPILER_RT_BUILD_ORC
=OFF \
50 -D CMAKE_C_COMPILER_LAUNCHER
=sccache \
51 -D CMAKE_CXX_COMPILER_LAUNCHER
=sccache \
52 -D MLIR_ENABLE_BINDINGS_PYTHON
=ON
55 # Targets are not escaped as they are passed as separate arguments.
56 ninja
-C "${BUILD_DIR}" ${targets}