[libcxx-commits] [libcxx] [libcxx] Passthrough the necessary CMake variables to benchmarks (PR #116644)

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 18 07:57:33 PST 2024


https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/116644

This addresses the issue uncovered by #115361. Previously, we weren't building benchmarks in many cases due to the following block:

https://github.com/llvm/llvm-project/blob/e58949632e91477af58d983f3b66369e6a2c8233/libcxx/CMakeLists.txt#L162-L172

We need to passthrough the necessary variables into the benchmarks subbuild and use correct syntax.

>From a898cdaeea6094ea8dbae54c025ac4bb06e21a3c Mon Sep 17 00:00:00 2001
From: Petr Hosek <phosek at google.com>
Date: Mon, 18 Nov 2024 15:53:15 +0000
Subject: [PATCH] [libcxx] Passthrough the necessary CMake variables to
 benchmarks

This addresses the issue uncovered by #115361. Previously, we weren't
building benchmarks in many cases due to the following block:

https://github.com/llvm/llvm-project/blob/e58949632e91477af58d983f3b66369e6a2c8233/libcxx/CMakeLists.txt#L162-L172

We need to passthrough the necessary variables into the benchmarks
subbuild and use correct syntax.
---
 libcxx/test/benchmarks/CMakeLists.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libcxx/test/benchmarks/CMakeLists.txt b/libcxx/test/benchmarks/CMakeLists.txt
index b5a4aae82c06ab..b0fe600623d964 100644
--- a/libcxx/test/benchmarks/CMakeLists.txt
+++ b/libcxx/test/benchmarks/CMakeLists.txt
@@ -35,13 +35,14 @@ ExternalProject_Add(google-benchmark
         SOURCE_DIR ${LLVM_THIRD_PARTY_DIR}/benchmark
         INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/google-benchmark
         CMAKE_CACHE_ARGS
-          -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
-          -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
+          -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
+          -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
+          -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}
           -DCMAKE_BUILD_TYPE:STRING=RELEASE
           -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
           -DCMAKE_CXX_FLAGS:STRING=${BENCHMARK_COMPILE_FLAGS}
           -DBENCHMARK_USE_LIBCXX:BOOL=ON
           -DBENCHMARK_ENABLE_TESTING:BOOL=OFF
-          -DBENCHMARK_CXX_LIBRARIES:STRING="${BENCHMARK_CXX_LIBRARIES}")
+          -DBENCHMARK_CXX_LIBRARIES:STRING=${BENCHMARK_CXX_LIBRARIES})
 
 add_dependencies(cxx-test-depends google-benchmark)



More information about the libcxx-commits mailing list