From 57c6d122a8779c69ac87323d1f86adf3ab8c18df Mon Sep 17 00:00:00 2001 From: Anselme Date: Mon, 16 Nov 2015 13:27:50 +0100 Subject: [PATCH] fixed error messages showing in release mode --- CMakeLists.txt | 6 +++++- glassert.h | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f320646..bd71da6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,12 @@ set(LIB_ROOT ${DEPENDENCIES_ROOT}/lib/${SYSTEM_LIB_PATH}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIB_ROOT}) #for SHARED set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIB_ROOT}) #for STATIC +if(CMAKE_BUILD_TYPE MATCHES "Debug") + set(CPP_DEFINES -DRENDER_DEBUG) +endif() + add_library(${LIBRARY_NAME} STATIC ${LIB_SRC_LIST}) -add_definitions(-std=c++11) +add_definitions(-std=c++11 ${CPP_DEFINES}) include_directories( ${INCLUDE_ROOT} diff --git a/glassert.h b/glassert.h index 3153cca..4be8ad0 100644 --- a/glassert.h +++ b/glassert.h @@ -10,6 +10,7 @@ #include #include +#ifdef RENDER_DEBUG #define STR(x) #x #define glAssert(code) \ code; \ @@ -19,6 +20,9 @@ std::cerr<<"Erreur OpenGL ("<<__FILE__<<":"<<__LINE__<<", "<