mirror of https://github.com/Icinga/icinga2.git
parent
1c92712146
commit
6ba0612644
|
@ -113,8 +113,17 @@ endif()
|
||||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Bin/${CMAKE_BUILD_TYPE} CACHE PATH "Library output path")
|
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Bin/${CMAKE_BUILD_TYPE} CACHE PATH "Library output path")
|
||||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Bin/${CMAKE_BUILD_TYPE} CACHE PATH "Executable output path")
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Bin/${CMAKE_BUILD_TYPE} CACHE PATH "Executable output path")
|
||||||
|
|
||||||
|
include(CheckSymbolExists)
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
include(CheckLibraryExists)
|
include(CheckLibraryExists)
|
||||||
|
|
||||||
|
check_symbol_exists(__COUNTER__ "" HAVE_COUNTER_MACRO)
|
||||||
|
|
||||||
|
if(NOT HAVE_COUNTER_MACRO AND ICINGA2_UNITY_BUILD)
|
||||||
|
message(STATUS "Your C/C++ compiler does not support the __COUNTER__ macro. Disabling unity build.")
|
||||||
|
set(ICINGA2_UNITY_BUILD FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_function_exists(vfork HAVE_VFORK)
|
check_function_exists(vfork HAVE_VFORK)
|
||||||
check_function_exists(backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
|
check_function_exists(backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
|
||||||
check_function_exists(pipe2 HAVE_PIPE2)
|
check_function_exists(pipe2 HAVE_PIPE2)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#cmakedefine HAVE_COUNTER_MACRO
|
||||||
#cmakedefine HAVE_BACKTRACE_SYMBOLS
|
#cmakedefine HAVE_BACKTRACE_SYMBOLS
|
||||||
#cmakedefine HAVE_PIPE2
|
#cmakedefine HAVE_PIPE2
|
||||||
#cmakedefine HAVE_VFORK
|
#cmakedefine HAVE_VFORK
|
||||||
|
|
|
@ -35,7 +35,7 @@ inline bool InitializeOnceHelper(InitializeFunc func)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INITIALIZE_ONCE(func) \
|
#define INITIALIZE_ONCE(func) \
|
||||||
namespace { namespace TOKENPASTE2(io, __COUNTER__) { \
|
namespace { namespace UNIQUE_NAME(io) { \
|
||||||
I2_EXPORT bool l_InitializeOnce(icinga::InitializeOnceHelper(func)); \
|
I2_EXPORT bool l_InitializeOnce(icinga::InitializeOnceHelper(func)); \
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ struct FactoryHelper
|
||||||
};
|
};
|
||||||
|
|
||||||
#define REGISTER_TYPE(type) \
|
#define REGISTER_TYPE(type) \
|
||||||
namespace { namespace TOKENPASTE2(rt, __COUNTER__) { \
|
namespace { namespace UNIQUE_NAME(rt) { \
|
||||||
void RegisterType(void) \
|
void RegisterType(void) \
|
||||||
{ \
|
{ \
|
||||||
icinga::Type *t = new TypeImpl<type>(); \
|
icinga::Type *t = new TypeImpl<type>(); \
|
||||||
|
|
|
@ -33,9 +33,11 @@ namespace icinga
|
||||||
#define TOKENPASTE(x, y) x ## y
|
#define TOKENPASTE(x, y) x ## y
|
||||||
#define TOKENPASTE2(x, y) TOKENPASTE(x, y)
|
#define TOKENPASTE2(x, y) TOKENPASTE(x, y)
|
||||||
|
|
||||||
#if defined(ICINGA2_UNITY_BUILD) && !defined(__COUNTER__)
|
#ifdef HAVE_COUNTER_MACRO
|
||||||
# error "Your compiler needs to support __COUNTER__ in order to do unity builds."
|
# define UNIQUE_NAME(prefix) TOKENPASTE2(prefix, __COUNTER__)
|
||||||
#endif /* ICINGA2_UNITY_BUILD && !defined(__COUNTER__) */
|
#else /* HAVE_COUNTER_MACRO */
|
||||||
|
# define UNIQUE_NAME(prefix) prefix
|
||||||
|
#endif /* HAVE_COUNTER_MACRO */
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define MS_VC_EXCEPTION 0x406D1388
|
#define MS_VC_EXCEPTION 0x406D1388
|
||||||
|
|
Loading…
Reference in New Issue