Skip to content

Commit

Permalink
build: Fix release builds with enabled FLB_DEBUG
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: ahspw <[email protected]>
  • Loading branch information
Garfield96 authored and ahspw committed Jan 16, 2024
1 parent e7bc87a commit d2c55d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit d2c55d0

Please sign in to comment.