From 717f71254eff4c9aa65565b2c54128833455c6d9 Mon Sep 17 00:00:00 2001 From: emeric Date: Tue, 19 Mar 2024 22:49:50 +0100 Subject: [PATCH] Fixed build when CMAKE_BUILD_TYPE is set to None --- CMakeLists.txt | 4 ++++ src/libs/database/CMakeLists.txt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0da122b0..2f06fbc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,10 @@ if (BUILD_BENCHMARKS) message(STATUS "Building benchmarks") endif() +if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-DNDEBUG) +endif() + add_subdirectory(src) install(DIRECTORY approot DESTINATION share/lms) diff --git a/src/libs/database/CMakeLists.txt b/src/libs/database/CMakeLists.txt index 30fc9a7c..b5e5a194 100644 --- a/src/libs/database/CMakeLists.txt +++ b/src/libs/database/CMakeLists.txt @@ -23,8 +23,8 @@ add_library(lmsdatabase SHARED impl/Utils.cpp ) -if (CMAKE_BUILD_TYPE MATCHES "Debug") -target_sources(lmsdatabase PRIVATE impl/TransactionChecker.cpp) +if (CMAKE_BUILD_TYPE STREQUAL "Debug") + target_sources(lmsdatabase PRIVATE impl/TransactionChecker.cpp) endif() target_include_directories(lmsdatabase INTERFACE