From 303c4c37ea49f9cf43e5252c4d97904e344c59cf Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Thu, 16 Jun 2022 13:39:01 -0400 Subject: [PATCH] [libc++] Don't force -O2 when building the benchmarks The optimization level used when building the benchmarks should match the optimization level of the current build. Otherwise, we can end up mixing an -O3 or -O0 optimized dylib with benchmarks built with -O2, which is really misleading. Differential Revision: https://reviews.llvm.org/D127987 --- libcxx/benchmarks/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/benchmarks/CMakeLists.txt b/libcxx/benchmarks/CMakeLists.txt index bc5052d..8a9c1a2 100644 --- a/libcxx/benchmarks/CMakeLists.txt +++ b/libcxx/benchmarks/CMakeLists.txt @@ -82,7 +82,7 @@ set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native) add_library( cxx-benchmarks-flags INTERFACE) target_compile_features( cxx-benchmarks-flags INTERFACE cxx_std_20) -target_compile_options( cxx-benchmarks-flags INTERFACE -O2 -fsized-deallocation -nostdinc++) +target_compile_options( cxx-benchmarks-flags INTERFACE -fsized-deallocation -nostdinc++) target_include_directories(cxx-benchmarks-flags INTERFACE "${LIBCXX_GENERATED_INCLUDE_DIR}" INTERFACE "${BENCHMARK_LIBCXX_INSTALL}/include" INTERFACE "${LIBCXX_SOURCE_DIR}/test/support") -- 2.7.4