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 <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2021-07-06 03:07:39 +00:00 committed by Liam Girdwood
parent 46ddb38159
commit ef03e727db
1 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,11 @@ cmake_minimum_required(VERSION 3.10)
project(SOF_SMEX C) 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}/..") set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..")
add_executable(smex add_executable(smex
@ -12,8 +17,9 @@ add_executable(smex
smex.c smex.c
) )
# In addition to the usual flags from CMAKE_BUILD_TYPE
target_compile_options(smex PRIVATE 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 target_include_directories(smex PRIVATE