Commit 0ae233ab by Jilin Zhou Committed by Dominic Hamon

[#766] add x-compile support for QNX SDP7 (#770)

Since googletest already supports x-compilation for QNX, it is nice to have google benchmark support it too. Fixes #766
parent 7c571338
...@@ -183,6 +183,10 @@ else() ...@@ -183,6 +183,10 @@ else()
add_definitions(-D_GNU_SOURCE=1) add_definitions(-D_GNU_SOURCE=1)
endif() endif()
if (QNXNTO)
add_definitions(-D_QNX_SOURCE)
endif()
# Link time optimisation # Link time optimisation
if (BENCHMARK_ENABLE_LTO) if (BENCHMARK_ENABLE_LTO)
add_cxx_compiler_flag(-flto) add_cxx_compiler_flag(-flto)
......
...@@ -70,6 +70,8 @@ ...@@ -70,6 +70,8 @@
#define BENCHMARK_OS_FUCHSIA 1 #define BENCHMARK_OS_FUCHSIA 1
#elif defined (__SVR4) && defined (__sun) #elif defined (__SVR4) && defined (__sun)
#define BENCHMARK_OS_SOLARIS 1 #define BENCHMARK_OS_SOLARIS 1
#elif defined(__QNX__)
#define BENCHMARK_OS_QNX 1
#endif #endif
#if defined(__ANDROID__) && defined(__GLIBCXX__) #if defined(__ANDROID__) && defined(__GLIBCXX__)
......
...@@ -389,6 +389,8 @@ std::string GetSystemName() { ...@@ -389,6 +389,8 @@ std::string GetSystemName() {
#else // defined(BENCHMARK_OS_WINDOWS) #else // defined(BENCHMARK_OS_WINDOWS)
#ifdef BENCHMARK_OS_MACOSX //Mac Doesnt have HOST_NAME_MAX defined #ifdef BENCHMARK_OS_MACOSX //Mac Doesnt have HOST_NAME_MAX defined
#define HOST_NAME_MAX 64 #define HOST_NAME_MAX 64
#elif defined(BENCHMARK_OS_QNX)
#define HOST_NAME_MAX 154
#endif #endif
char hostname[HOST_NAME_MAX]; char hostname[HOST_NAME_MAX];
int retVal = gethostname(hostname, HOST_NAME_MAX); int retVal = gethostname(hostname, HOST_NAME_MAX);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment