From 256a466b5f8657c7245dbdecadf5303809c291de Mon Sep 17 00:00:00 2001 From: Christian Norbert Menges Date: Wed, 18 Oct 2023 15:41:43 +0200 Subject: [PATCH] build: Fix release builds with enabled FLB_DEBUG Enabling FLB_RELEASE should enable compiler optimizations. However, if FLB_DEBUG was enabled at the same time, no optimization settings were applied. Now, FLB_RELEASE will always enable optimizations and includes debug information (CMAKE_BUILD_TYPE is RelWithDebInfo). Signed-off-by: Christian Norbert Menges --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44c5bd1c559..0992ec60ca1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -432,10 +432,10 @@ endif() # Enable Debug symbols if specified if(MSVC) set(CMAKE_BUILD_TYPE None) # Avoid flag conflicts (See CMakeList.txt:L18) -elseif(FLB_DEBUG) - set(CMAKE_BUILD_TYPE "Debug") elseif(FLB_RELEASE) set(CMAKE_BUILD_TYPE "RelWithDebInfo") +elseif(FLB_DEBUG) + set(CMAKE_BUILD_TYPE "Debug") endif() if(FLB_IPO STREQUAL "On" OR (FLB_IPO STREQUAL "ReleaseOnly" AND FLB_RELEASE))