From 9126fbd804ad76bd9771f9f23f44e0901b15cd3a Mon Sep 17 00:00:00 2001 From: icex2 Date: Mon, 4 Jan 2021 22:57:44 +0100 Subject: [PATCH] cmake: Remove public release compile branch, not used anymore This furthermore fixes the argument positioning of -g which needs to be part of the compiler flags not linker flags. Fixes not showing line numbers and source files on valgrind --- cmake/CMakeLists.txt | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b47daf9..f74a530 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,11 +1,5 @@ cmake_minimum_required(VERSION 2.8) -option(PT_PUBLIC_RELEASE "PT_PUBLIC_RELEASE" "0") - -if (PT_PUBLIC_RELEASE STREQUAL "1") - message(WARNING "!!! Compiling public release !!!\n!!! Compiling public release !!!\n!!! Compiling public release !!!") -endif () - # set git revision execute_process(COMMAND git log -1 --format=%h --date=short HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GITREV ERROR_QUIET) string(STRIP "${GITREV}" GITREV) @@ -46,19 +40,11 @@ set(CMAKE_CXX_STANDARD 14) # Important note: Don't use -O3 because that will break the dongle emulation code for microdog40 (wtf) # Also, -O3 seems to optimize too much stuff and kills the amixer-block module entirely (the system() preload # can't be called anymore) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGITREV=${GITREV} -pipe -Wall -Werror -std=gnu99 -D_GNU_SOURCE -Wno-attributes -m32") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGITREV=${GITREV} -pipe -Wall -Werror -std=gnu99 -D_GNU_SOURCE -Wno-attributes -m32 -g") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined -m32") # Enable debug flags on non public builds -if (PT_PUBLIC_RELEASE STREQUAL "0") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -g -rdynamic") -endif () - -# Disable asserts and strip binary -if (PT_PUBLIC_RELEASE STREQUAL "1") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG -DPT_PUBLIC_RELEASE") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -s") -endif () +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -rdynamic") add_subdirectory(src)