[libc++] Disallow running the libc++ benchmarks in standalone builds
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 9 Nov 2021 19:44:19 +0000 (14:44 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Thu, 11 Nov 2021 19:13:36 +0000 (14:13 -0500)
We are trying to remove duplication of third-party code in
https://reviews.llvm.org/D112012, which will move the Google
Benchmark code outside of the `libcxx/` directory. That breaks
running the benchmarks in the Standalone build. Since we have
deprecated the Standalone build anyway, this patch just removes
support for the benchmark in Standalone mode until we remove that
mode entirely.

Differential Revision: https://reviews.llvm.org/D113503

libcxx/benchmarks/CMakeLists.txt
libcxx/utils/ci/run-buildbot

index 67e643c..8758c6b 100644 (file)
@@ -3,6 +3,12 @@ if (CMAKE_VERSION VERSION_LESS 3.17)
   return()
 endif()
 
+if (LIBCXX_STANDALONE_BUILD)
+  message(WARNING "The libc++ benchmarks are not available in a standalone build. Please migrate to an official build "
+                  "as documented in https://libcxx.llvm.org/BuildingLibcxx.html.")
+  return()
+endif()
+
 include(ExternalProject)
 include(CheckCXXCompilerFlag)
 
index b36f6d7..579721f 100755 (executable)
@@ -520,6 +520,7 @@ legacy-standalone)
           -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
           -DLLVM_PATH="${MONOREPO_ROOT}/llvm" \
           -DLIBCXX_CXX_ABI=libcxxabi \
+          -DLIBCXX_INCLUDE_BENCHMARKS=OFF \
           -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${MONOREPO_ROOT}/libcxxabi/include" \
           -DLIBCXX_CXX_ABI_LIBRARY_PATH="${BUILD_DIR}/libcxxabi/lib"