diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index 05e662885..512f5926d 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -21,6 +21,12 @@ project(WinPR C) set(CMAKE_COLOR_MAKEFILE ON) +option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON) + +if (WITH_VERBOSE_WINPR_ASSERT) + add_definitions(-DWITH_VERBOSE_WINPR_ASSERT) +endif() + if(FREERDP_VERSION) set(FREERDP_BUILD 1) endif() diff --git a/winpr/include/winpr/assert.h b/winpr/include/winpr/assert.h index 724f82b97..ae9deb2e7 100644 --- a/winpr/include/winpr/assert.h +++ b/winpr/include/winpr/assert.h @@ -26,6 +26,7 @@ #include #include +#if WITH_VERBOSE_WINPR_ASSERT #define WINPR_ASSERT(cond) \ do \ { \ @@ -36,6 +37,12 @@ abort(); \ } \ } while (0) +#else +#define WINPR_ASSERT(cond) \ + do \ + { \ + } while (0) +#endif #ifdef __cplusplus extern "C"