summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt12
-rw-r--r--WIN32-Code/evconfig-private.h6
-rw-r--r--evconfig-private.h.cmake35
3 files changed, 45 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63367a74..3e822356 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -558,9 +558,17 @@ source_group("Headers Public" FILES ${HDR_PUBLIC})
source_group("Source Core" FILES ${SRC_CORE})
source_group("Source Extra" FILES ${SRC_EXTRA})
+# Generate the configure headers.
+# (Place them in the build dir so we don't polute the source tree with generated files).
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
+
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/event-config.h.cmake
- ${CMAKE_CURRENT_SOURCE_DIR}/include/event2/event-config.h)
+ ${CMAKE_CURRENT_BINARY_DIR}/include/event2/event-config.h)
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/evconfig-private.h.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/include/evconfig-private.h)
# TODO: Add dynamic versions of the libraries as well.
add_library(event_core STATIC
@@ -681,7 +689,7 @@ if (NOT EVENT__DISABLE_TESTS)
set(BACKENDS EVPORT KQUEUE EPOLL DEVPOLL POLL SELECT WIN32)
set(DEFAULT_TEST_ENV_VARS "")
foreach(BACKEND ${BACKENDS})
- list(APPEND DEFAULT_TEST_ENV_VARS "EVENT_NO${BACKEND}")
+ list(APPEND DEFAULT_TEST_ENV_VARS "EVENT_NO${BACKEND}=1")
endforeach()
# Macro that creates the ctest test for a backend.
diff --git a/WIN32-Code/evconfig-private.h b/WIN32-Code/evconfig-private.h
deleted file mode 100644
index 88e20627..00000000
--- a/WIN32-Code/evconfig-private.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#if !defined(EVENT_EVCONFIG__PRIVATE_H_) && !defined(__MINGW32__)
-#define EVENT_EVCONFIG__PRIVATE_H_
-
-/* Nothing to see here. Move along. */
-
-#endif
diff --git a/evconfig-private.h.cmake b/evconfig-private.h.cmake
new file mode 100644
index 00000000..32f04794
--- /dev/null
+++ b/evconfig-private.h.cmake
@@ -0,0 +1,35 @@
+
+#ifndef EVCONFIG_PRIVATE_H_INCLUDED_
+#define EVCONFIG_PRIVATE_H_INCLUDED_
+
+/* Enable extensions on AIX 3, Interix. */
+#cmakedefine _ALL_SOURCE
+
+/* Enable GNU extensions on systems that have them. */
+#cmakedefine _GNU_SOURCE 1
+
+/* Enable threading extensions on Solaris. */
+#cmakedefine _POSIX_PTHREAD_SEMANTICS 1
+
+/* Enable extensions on HP NonStop. */
+#cmakedefine _TANDEM_SOURCE 1
+
+/* Enable general extensions on Solaris. */
+#cmakedefine __EXTENSIONS__
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#cmakedefine _FILE_OFFSET_BITS 1
+/* Define for large files, on AIX-style hosts. */
+#cmakedefine _LARGE_FILES 1
+
+/* Define to 1 if on MINIX. */
+#cmakedefine _MINIX 1
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#cmakedefine _POSIX_1_SOURCE 1
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#cmakedefine _POSIX_SOURCE 1
+
+#endif