@@ -18,7 +18,6 @@ set -o pipefail
1818
1919MONOREPO_ROOT=" ${MONOREPO_ROOT:= " $( git rev-parse --show-toplevel) " } "
2020BUILD_DIR=" ${BUILD_DIR:= ${MONOREPO_ROOT} / build} "
21- INSTALL_DIR=" ${BUILD_DIR} /install"
2221rm -rf " ${BUILD_DIR} "
2322
2423ccache --zero-stats
@@ -85,69 +84,45 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
8584 -D LIBCXX_CXX_ABI=libcxxabi \
8685 -D MLIR_ENABLE_BINDINGS_PYTHON=ON \
8786 -D LLDB_ENABLE_PYTHON=ON \
88- -D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
89- -D CMAKE_INSTALL_PREFIX=" ${INSTALL_DIR} "
87+ -D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON
9088
9189echo " --- ninja"
90+
9291# Targets are not escaped as they are passed as separate arguments.
9392ninja -C " ${BUILD_DIR} " -k 0 ${targets}
9493
9594runtimes=" ${3} "
9695runtime_targets=" ${4} "
9796
98- # Compiling runtimes with just-built Clang and running their tests
99- # as an additional testing for Clang.
97+ # Run runtimes tests.
98+ # We don't need to do a clean separate build of runtimes, because runtimes
99+ # will be built against just built clang, and because LIBCXX_TEST_PARAMS
100+ # and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
101+ # propagates without a clean build. Other that those two variables, builds
102+ # are supposed to be the same.
100103if [[ " ${runtimes} " != " " ]]; then
101104 if [[ " ${runtime_targets} " == " " ]]; then
102105 echo " Runtimes to build are specified, but targets are not."
103106 exit 1
104107 fi
105108
106- echo " --- ninja install-clang"
107-
108- ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
109-
110- RUNTIMES_BUILD_DIR=" ${MONOREPO_ROOT} /build-runtimes"
111- INSTALL_DIR=" ${BUILD_DIR} /install"
112- mkdir -p ${RUNTIMES_BUILD_DIR}
113-
114109 echo " --- cmake runtimes C++26"
115110
116- rm -rf " ${RUNTIMES_BUILD_DIR} "
117- cmake -S " ${MONOREPO_ROOT} /runtimes" -B " ${RUNTIMES_BUILD_DIR} " -GNinja \
118- -D CMAKE_C_COMPILER=" ${INSTALL_DIR} /bin/clang" \
119- -D CMAKE_CXX_COMPILER=" ${INSTALL_DIR} /bin/clang++" \
120- -D LLVM_ENABLE_RUNTIMES=" ${runtimes} " \
121- -D LIBCXX_CXX_ABI=libcxxabi \
122- -D CMAKE_BUILD_TYPE=RelWithDebInfo \
123- -D CMAKE_INSTALL_PREFIX=" ${INSTALL_DIR} " \
111+ cmake -S " ${MONOREPO_ROOT} " /llvm -B " ${BUILD_DIR} " \
124112 -D LIBCXX_TEST_PARAMS=" std=c++26" \
125- -D LIBCXXABI_TEST_PARAMS=" std=c++26" \
126- -D LLVM_LIT_ARGS=" ${lit_args} "
113+ -D LIBCXXABI_TEST_PARAMS=" std=c++26"
127114
128115 echo " --- ninja runtimes C++26"
129116
130- ninja -vC " ${RUNTIMES_BUILD_DIR } " ${runtime_targets}
117+ ninja -vC " ${BUILD_DIR } " ${runtime_targets}
131118
132119 echo " --- cmake runtimes clang modules"
133120
134- # We don't need to do a clean build of runtimes, because LIBCXX_TEST_PARAMS
135- # and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
136- # propagates without a clean build. Other that those two variables, builds
137- # are supposed to be the same.
138-
139- cmake -S " ${MONOREPO_ROOT} /runtimes" -B " ${RUNTIMES_BUILD_DIR} " -GNinja \
140- -D CMAKE_C_COMPILER=" ${INSTALL_DIR} /bin/clang" \
141- -D CMAKE_CXX_COMPILER=" ${INSTALL_DIR} /bin/clang++" \
142- -D LLVM_ENABLE_RUNTIMES=" ${runtimes} " \
143- -D LIBCXX_CXX_ABI=libcxxabi \
144- -D CMAKE_BUILD_TYPE=RelWithDebInfo \
145- -D CMAKE_INSTALL_PREFIX=" ${INSTALL_DIR} " \
121+ cmake -S " ${MONOREPO_ROOT} " /llvm -B " ${BUILD_DIR} " \
146122 -D LIBCXX_TEST_PARAMS=" enable_modules=clang" \
147- -D LIBCXXABI_TEST_PARAMS=" enable_modules=clang" \
148- -D LLVM_LIT_ARGS=" ${lit_args} "
123+ -D LIBCXXABI_TEST_PARAMS=" enable_modules=clang"
149124
150125 echo " --- ninja runtimes clang modules"
151126
152- ninja -vC " ${RUNTIMES_BUILD_DIR } " ${runtime_targets}
127+ ninja -vC " ${BUILD_DIR } " ${runtime_targets}
153128fi
0 commit comments