From ef03e727dbd8e1c5fb248d7e8758b7d02aa6ba07 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 6 Jul 2021 03:07:39 +0000 Subject: [PATCH] smex: un-hardcode "-O2 -g", use CMAKE_BUILD_TYPE, default to Debug Anyone having a performance issue can use the standard -DCMAKE_BUILD_TYPE=Release. Crashes seem more common. Signed-off-by: Marc Herbert --- smex/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/smex/CMakeLists.txt b/smex/CMakeLists.txt index 9e73e29ae..b5bfa6a87 100644 --- a/smex/CMakeLists.txt +++ b/smex/CMakeLists.txt @@ -4,6 +4,11 @@ cmake_minimum_required(VERSION 3.10) project(SOF_SMEX C) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "No CMAKE_BUILD_TYPE, defaulting to Debug") + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) +endif() + set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..") add_executable(smex @@ -12,8 +17,9 @@ add_executable(smex smex.c ) +# In addition to the usual flags from CMAKE_BUILD_TYPE target_compile_options(smex PRIVATE - -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 + -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 ) target_include_directories(smex PRIVATE