From d2c55d0f44b83190e19c1ee90d5d67019ba03979 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 Signed-off-by: ahspw --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d638191b48..e870fd67654 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -438,10 +438,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))