set(ICINGA2_UNITY_BUILD ON CACHE BOOL "Whether to perform a unity build")
set(ICINGA2_LTO_BUILD OFF CACHE BOOL "Whether to use LTO")
+site_name(ICINGA2_BUILD_HOST_NAME)
+set(ICINGA2_BUILD_COMPILER_NAME "${CMAKE_CXX_COMPILER_ID}")
+
+if(NOT CMAKE_CXX_COMPILER_VERSION)
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
+ OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
+endif()
+
+set(ICINGA2_BUILD_COMPILER_VERSION "${CMAKE_CXX_COMPILER_VERSION}")
+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING" ICINGA2_LICENSE_GPL)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.Exceptions" ICINGA2_LICENSE_ADDITIONS)
set(ICINGA2_LICENSE "${ICINGA2_LICENSE_GPL}\n\n---\n\n${ICINGA2_LICENSE_ADDITIONS}")
#define ICINGA_USER "${ICINGA2_USER}"
#define ICINGA_GROUP "${ICINGA2_GROUP}"
+#define ICINGA_BUILD_HOST_NAME "${ICINGA2_BUILD_HOST_NAME}"
+#define ICINGA_BUILD_COMPILER_NAME "${ICINGA2_BUILD_COMPILER_NAME}"
+#define ICINGA_BUILD_COMPILER_VERSION "${ICINGA2_BUILD_COMPILER_VERSION}"
+
#endif /* CONFIG_H */
PlatformVersion |**Read-only.** The version of the operating system, e.g. "14.04.3 LTS".
PlatformKernel |**Read-only.** The name of the operating system kernel, e.g. "Linux".
PlatformKernelVersion|**Read-only.** The version of the operating system kernel, e.g. "3.13.0-63-generic".
+BuildCompilerName |**Read-only.** The name of the compiler Icinga was built with, e.g. "Clang".
+BuildCompilerVersion|**Read-only.** The version of the compiler Icinga was built with, e.g. "7.3.0.7030031".
+BuildHostName |**Read-only.** The name of the host Icinga was built on, e.g. "acheron".
## <a id="apply"></a> Apply
ScriptGlobal::Set("PlatformVersion", Utility::GetPlatformVersion());
ScriptGlobal::Set("PlatformArchitecture", Utility::GetPlatformArchitecture());
+ ScriptGlobal::Set("BuildHostName", ICINGA_BUILD_HOST_NAME);
+ ScriptGlobal::Set("BuildCompilerName", ICINGA_BUILD_COMPILER_NAME);
+ ScriptGlobal::Set("BuildCompilerVersion", ICINGA_BUILD_COMPILER_VERSION);
+
LogSeverity logLevel = Logger::GetConsoleLogSeverity();
Logger::SetConsoleLogSeverity(LogWarning);
<< " Kernel: " << Utility::GetPlatformKernel() << "\n"
<< " Kernel version: " << Utility::GetPlatformKernelVersion() << "\n"
<< " Architecture: " << Utility::GetPlatformArchitecture() << "\n";
+
+ os << "\n"
+ << "Build information:" << "\n"
+ << " Compiler: " << ScriptGlobal::Get("BuildCompilerName") << " " << ScriptGlobal::Get("BuildCompilerVersion") << "\n"
+ << " Build host: " << ScriptGlobal::Get("BuildHostName") << "\n";
}
/**