diff --git a/CMakeLists.txt b/CMakeLists.txt index d1055456b..1c3780bf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,11 @@ if(NOT HAVE_COUNTER_MACRO AND ICINGA2_UNITY_BUILD) set(ICINGA2_UNITY_BUILD FALSE) endif() +if(NOT MSVC) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") +endif() + check_function_exists(vfork HAVE_VFORK) check_function_exists(backtrace_symbols HAVE_BACKTRACE_SYMBOLS) check_function_exists(pipe2 HAVE_PIPE2) diff --git a/INSTALL.md b/INSTALL.md index 0ee1f828c..68b064d41 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -138,7 +138,7 @@ variables are supported: - `ICINGA2_GROUP`: The group Icinga 2 should run as; defaults to `icinga` - `ICINGA2_GIT_VERSION_INFO`: Whether to use Git to determine the version number; defaults to `ON` - `ICINGA2_COMMAND_GROUP`: The command group Icinga 2 should use; defaults to `icingacmd` -- `ICINGA2_UNITY_BUILD`: Whether to perform a unity build +- `ICINGA2_UNITY_BUILD`: Whether to perform a unity build; defaults to `OFF` - `ICINGA2_PLUGINDIR`: The path for the Monitoring Plugins project binaries; defaults to `/usr/lib/nagios/plugins` - `ICINGA2_RUNDIR`: The location of the "run" directory; defaults to `CMAKE_INSTALL_LOCALSTATEDIR/run` - `CMAKE_INSTALL_SYSCONFDIR`: The configuration directory; defaults to `CMAKE_INSTALL_PREFIX/etc` diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index e05ee9cf7..14925ec08 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -273,7 +273,11 @@ int Main(void) appName = appName.SubStr(3, appName.GetLength() - 3); std::cout << appName << " " << "- The Icinga 2 network monitoring daemon (version: " - << Application::GetVersion() << ")" << std::endl << std::endl; + << Application::GetVersion() +#ifdef _DEBUG + << "; debug" +#endif /* _DEBUG */ + << ")" << std::endl << std::endl; if (!command || vm.count("help")) { std::cout << "Usage:" << std::endl diff --git a/lib/base/i2-base.hpp b/lib/base/i2-base.hpp index b837122ce..19f203634 100644 --- a/lib/base/i2-base.hpp +++ b/lib/base/i2-base.hpp @@ -56,10 +56,6 @@ # pragma warning(disable:4251) # pragma warning(disable:4275) # pragma warning(disable:4345) -#else /* _MSC_VER */ -# ifndef NDEBUG -# define _DEBUG -# endif /* NDEBUG */ #endif /* _MSC_VER */ #include "config.h" diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp index 77eb811aa..3a58e38d6 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -325,7 +325,11 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector