From 961b545da0d4aba53c36bb5b670f7cb87728436a Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 26 Oct 2020 11:55:55 -0400 Subject: [PATCH] cmake: respect MAX_CUSTOM_OPT_LEVEL if set - ignored for Debug and Coverage builds --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf9819855b..603d0ca6f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,12 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) endif() +if(NOT (${CMAKE_BUILD_TYPE} MATCHES "Coverage") AND NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug")) + if(MAX_CUSTOM_OPT_LEVEL) + add_compile_options(${MAX_CUSTOM_OPT_LEVEL}) + endif() +endif() + # santiziers (ASAN) if(ECL_ASAN) message(STATUS "ecl address sanitizer enabled ")