Fix _DEBUG define on *NIX

This commit is contained in:
Gunnar Beutner 2014-11-12 11:34:59 +01:00
parent b3aa2eb0c8
commit dfd24e6359
5 changed files with 16 additions and 7 deletions

View File

@ -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)

View File

@ -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`

View File

@ -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

View File

@ -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"

View File

@ -325,7 +325,11 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
Application::MakeVariablesConstant();
Log(LogInformation, "cli")
<< "Icinga application loader (version: " << Application::GetVersion() << ")";
<< "Icinga application loader (version: " << Application::GetVersion()
#ifdef _DEBUG
<< "; debug"
#endif /* _DEBUG */
<< ")";
String appType = LoadAppType(Application::GetApplicationType());