[libcxx-commits] [libcxx] 303c4c3 - [libc++] Don't force -O2 when building the benchmarks

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 17 14:34:11 PDT 2022


Author: Louis Dionne
Date: 2022-06-17T17:34:02-04:00
New Revision: 303c4c37ea49f9cf43e5252c4d97904e344c59cf

URL: https://github.com/llvm/llvm-project/commit/303c4c37ea49f9cf43e5252c4d97904e344c59cf
DIFF: https://github.com/llvm/llvm-project/commit/303c4c37ea49f9cf43e5252c4d97904e344c59cf.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/benchmarks/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxx/benchmarks/CMakeLists.txt b/libcxx/benchmarks/CMakeLists.txt
index bc5052da854f1..8a9c1a2c6d216 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")


        


More information about the libcxx-commits mailing list