From 71746b35718e856a5f8615f95f35d450a142e8cd 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 de21370633c..d54d87e021b 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))