[libcxx-commits] [libcxx] [libc++] Address missing cmake in libcxx.test.googlebenchmark (PR #225590)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Sep 22 22:57:52 PDT 2026
https://github.com/zeroomega updated https://github.com/llvm/llvm-project/pull/225590
>From 5e7c43f3eca207b09b318c02ae9a44dc2c15a7bf Mon Sep 17 00:00:00 2001
From: Haowei Wu <haowei at google.com>
Date: Tue, 22 Sep 2026 21:38:50 -0700
Subject: [PATCH] [libc++] Address missing cmake in libcxx.test.googlebenchmark
We are seeing python exception after #224192 was landed as cmake
could not be found if "CMAKE" is absent from environment variables.
This patch addresses this issue by using cmake from lit config.
---
libcxx/test/CMakeLists.txt | 1 +
libcxx/utils/libcxx/test/googlebenchmark.py | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index 85fa6aacc7796..d49297e5fabe3 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -24,6 +24,7 @@ set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!"
set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n")
serialize_lit_string_param(SERIALIZED_LIT_PARAMS compiler "${CMAKE_CXX_COMPILER}")
+serialize_lit_string_param(SERIALIZED_LIT_PARAMS cmake "${CMAKE_COMMAND}")
if (LIBCXX_INCLUDE_BENCHMARKS)
set(_libcxx_benchmark_mode "dry-run")
diff --git a/libcxx/utils/libcxx/test/googlebenchmark.py b/libcxx/utils/libcxx/test/googlebenchmark.py
index b5fe708e67f8c..9d81e56efedad 100644
--- a/libcxx/utils/libcxx/test/googlebenchmark.py
+++ b/libcxx/utils/libcxx/test/googlebenchmark.py
@@ -180,7 +180,11 @@ def prepare(config, litConfig):
installDir = os.path.join(prefix, "install")
os.makedirs(root, exist_ok=True)
- cmake = os.environ.get("CMAKE", "cmake")
+ cmake = (
+ litConfig.params.get("cmake")
+ or getattr(config, "cmake", None)
+ or os.environ.get("CMAKE", "cmake")
+ )
if not os.path.exists(os.path.join(buildDir, "CMakeCache.txt")):
litConfig.note("Configuring GoogleBenchmark in {}".format(buildDir))
More information about the libcxx-commits
mailing list