]> granicus.if.org Git - icinga2/commitdiff
Fix _DEBUG define on *NIX
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 12 Nov 2014 10:34:59 +0000 (11:34 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 12 Nov 2014 10:34:59 +0000 (11:34 +0100)
CMakeLists.txt
INSTALL.md
icinga-app/icinga.cpp
lib/base/i2-base.hpp
lib/cli/daemoncommand.cpp

index d1055456b733c959e7d1704b702612a4677ad006..1c3780bf30b517ace9ccea497bb1215068a893df 100644 (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)
index 0ee1f828c478a5cbc13e0ebda1146f68a541f722..68b064d412e6160a4076478e883c3d4087a48d9e 100644 (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`
index e05ee9cf7e583abd5bbc164bdea480119185feaa..14925ec089610fa9d5362bd5c6e911455d27279e 100644 (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
index b837122ce6d8e80debd393be5321f94c36aa268b..19f20363439fac8d8ba0aee090c6d22da92e46cd 100644 (file)
 #      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"
index 77eb811aabbac5853ce6703b359c09cc24b36652..3a58e38d6966f88e10f54b9f2a25d48b7c820ab7 100644 (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());