]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: clock_gettime
authorFred Morcos <fred.morcos@open-xchange.com>
Wed, 5 Jul 2023 10:28:30 +0000 (12:28 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:27 +0000 (13:28 +0100)
meson.build
meson/clock-gettime/meson.build [new file with mode: 0644]

index a2404773ea19493989e4f255837e0f3f6859cb11..6dcfa5347f8eea03a2265be5d4b524ec403630db 100644 (file)
@@ -42,6 +42,7 @@ subdir('meson/gnutls')          # GnuTLS
 subdir('meson/dot')             # DNS over TLS
 subdir('meson/ipcipher')        # IPCipher
 subdir('meson/ragel')           # Find Ragel
+subdir('meson/clock-gettime')   # Clock_gettime
 
 # Find or generate pdns/dnslabeltext.cc
 if not ragel.found() and not fs.exists('pdns/dnslabeltext.cc')
diff --git a/meson/clock-gettime/meson.build b/meson/clock-gettime/meson.build
new file mode 100644 (file)
index 0000000..63998df
--- /dev/null
@@ -0,0 +1,17 @@
+# Clock_gettime
+# Inputs: deps
+
+found = cxx.has_function('clock_gettime')
+
+if not found
+  lib = cxx.find_library('rt', required: true)
+
+  if not cxx.has_function('clock_gettime', dependencies: lib)
+    error('Cannot find function ' + 'clock_gettime')
+  endif
+
+  deps += lib
+  found = lib.name() + ' ' + lib.version()
+endif
+
+summary('clock_gettime', found, bool_yn: true, section: 'System')