cmake: Export cmake config for socket_wrapper_noop
[socket_wrapper.git] / ConfigureChecks.cmake
index 4a2f55e95258f67ad310f0c9671a28ce0333fa61..2c78b83f168dabde65f1c1b20dc7c03bc0ff0b31 100644 (file)
@@ -7,8 +7,8 @@ include(CheckStructHasMember)
 include(CheckPrototypeDefinition)
 include(TestBigEndian)
 
-set(PACKAGE ${PROJECT_NAME})
-set(VERSION ${PROJECT_VERSION})
+set(SOCKET_WRAPPER_PACKAGE ${PROJECT_NAME})
+set(SOCKET_WRAPPER_VERSION ${PROJECT_VERSION})
 
 set(BINARYDIR ${CMAKE_BINARY_DIR})
 set(SOURCEDIR ${CMAKE_SOURCE_DIR})
@@ -74,6 +74,7 @@ check_function_exists(getexecname HAVE_GETEXECNAME)
 check_function_exists(pledge HAVE_PLEDGE)
 check_function_exists(_socket HAVE__SOCKET)
 check_function_exists(_close HAVE__CLOSE)
+check_function_exists(__close_nocancel HAVE___CLOSE_NOCANCEL)
 
 if (UNIX)
     find_library(DLFCN_LIBRARY dl)
@@ -216,6 +217,32 @@ int main(void) {
     return 0;
 }" HAVE_DESTRUCTOR_ATTRIBUTE)
 
+check_c_source_compiles("
+#pragma init (test_constructor)
+void test_constructor(void);
+
+void test_constructor(void)
+{
+    return;
+}
+
+int main(void) {
+    return 0;
+}" HAVE_PRAGMA_INIT)
+
+check_c_source_compiles("
+#pragma fini (test_destructor)
+void test_destructor(void);
+
+void test_destructor(void)
+{
+    return;
+}
+
+int main(void) {
+    return 0;
+}" HAVE_PRAGMA_FINI)
+
 check_c_source_compiles("
 #define FALL_THROUGH __attribute__((fallthrough))