From 5a361b4378ea5770c84a5c2baaba19d0135d4b36 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Tue, 16 May 2023 05:30:59 +0300 Subject: CMake: Added -NDEBUG macro when Release build is --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eeedcc8..fe7db37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,13 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID ST set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") endif() +if(DEFINED CMAKE_BUILD_TYPE) + string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) +endif() +if(CMAKE_BUILD_TYPE_LOWER EQUAL "release") + add_definitions(-DNDEBUG) +ENDIF() + # Disable bogus MSVC warnings if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) -- cgit v1.2.3