66 lines · bash
1#!/usr/bin/env bash2#===----------------------------------------------------------------------===##3#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-exception7#8#===----------------------------------------------------------------------===##9 10#11# This script performs a monolithic build of the monorepo and runs the tests of12# most projects on Windows. This should be replaced by per-project scripts that13# run only the relevant tests.14#15 16source .ci/utils.sh17 18projects="${1}"19targets="${2}"20runtimes="${3}"21runtimes_targets="${4}"22 23start-group "CMake"24pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt25 26export CC=C:/clang/clang-msvc/bin/clang-cl.exe27export CXX=C:/clang/clang-msvc/bin/clang-cl.exe28export LD=link29 30# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research31# on fixing a build reliability issue on the build server, please32# see https://github.com/llvm/llvm-project/pull/82393 and33# https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/4034# for further information.35cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \36 -D LLVM_ENABLE_PROJECTS="${projects}" \37 -G Ninja \38 -D CMAKE_BUILD_TYPE=Release \39 -D LLVM_ENABLE_ASSERTIONS=ON \40 -D LLVM_BUILD_EXAMPLES=ON \41 -D COMPILER_RT_BUILD_LIBFUZZER=OFF \42 -D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests --succinct" \43 -D COMPILER_RT_BUILD_ORC=OFF \44 -D CMAKE_C_COMPILER_LAUNCHER=sccache \45 -D CMAKE_CXX_COMPILER_LAUNCHER=sccache \46 -D MLIR_ENABLE_BINDINGS_PYTHON=ON \47 -D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \48 -D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \49 -D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \50 -D LLVM_ENABLE_RUNTIMES="${runtimes}"51 52start-group "ninja"53 54if [[ -n "${targets}" ]]; then55 # Targets are not escaped as they are passed as separate arguments.56 ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log57 cp ${BUILD_DIR}/.ninja_log ninja.ninja_log58fi59 60if [[ -n "${runtimes_targets}" ]]; then61 start-group "ninja runtimes"62 63 ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log64 cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log65fi66