[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
This commit is contained in:
Louis Dionne 2022-06-16 13:39:01 -04:00
parent cbf6737cc4
commit 303c4c37ea

View File

@ -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")