uwrap: Always enable logging
[uid_wrapper.git] / ConfigureChecks.cmake
index 899d90504f40a4cfc0b21de526c7f86aff3346f3..150d89b4dbe0ba0223ca8d0e90ca8f4f29679f14 100644 (file)
@@ -61,6 +61,8 @@ check_function_exists(snprintf HAVE_SNPRINTF)
 check_function_exists(seteuid HAVE_SETEUID)
 check_function_exists(setreuid HAVE_SETREUID)
 check_function_exists(setresuid HAVE_SETRESUID)
+check_function_exists(getresuid HAVE_GETRESUID)
+check_function_exists(getresgid HAVE_GETRESGID)
 
 check_function_exists(setegid HAVE_SETEGID)
 check_function_exists(setregid HAVE_SETREGID)
@@ -124,6 +126,15 @@ int main(void) {
     set(CMAKE_REQUIRED_DEFINITIONS)
 endif (LINUX)
 
+check_c_source_compiles("
+#include <stdbool.h>
+int main(void) {
+    bool x;
+    bool *p_x = &x;
+    __atomic_load(p_x, &x, __ATOMIC_RELAXED);
+    return 0;
+}" HAVE_GCC_ATOMIC_BUILTINS)
+
 check_c_source_compiles("
 __thread int tls;
 
@@ -131,6 +142,18 @@ int main(void) {
     return 0;
 }" HAVE_GCC_THREAD_LOCAL_STORAGE)
 
+check_c_source_compiles("
+void test_constructor_attribute(void) __attribute__ ((constructor));
+
+void test_constructor_attribute(void)
+{
+     return;
+}
+
+int main(void) {
+     return 0;
+}" HAVE_CONSTRUCTOR_ATTRIBUTE)
+
 check_c_source_compiles("
 void test_destructor_attribute(void) __attribute__ ((destructor));
 
@@ -143,6 +166,21 @@ int main(void) {
     return 0;
 }" HAVE_DESTRUCTOR_ATTRIBUTE)
 
+# If this produces a warning treat it as error!
+set(CMAKE_REQUIRED_FLAGS "-Werror")
+check_c_source_compiles("
+void test_address_sanitizer_attribute(void) __attribute__((no_sanitize_address));
+
+void test_address_sanitizer_attribute(void)
+{
+    return;
+}
+
+int main(void) {
+    return 0;
+}" HAVE_ADDRESS_SANITIZER_ATTRIBUTE)
+set(CMAKE_REQUIRED_FLAGS)
+
 check_c_source_compiles("
 void log_fn(const char *format, ...) __attribute__ ((format (printf, 1, 2)));