summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2019-04-04 15:20:08 +0200
committerOndrej Holy <oholy@redhat.com>2019-05-16 09:36:59 +0000
commit70128710da23966a1d5f4b2cbcca0ccb63c4d0f1 (patch)
tree4ec41bc08dc8c278c4a8b7c6d2c326a4aaefaeef /meson.build
parent75d8fb3df62f921b9ff3b6068c05ccdba526af20 (diff)
downloadgvfs-70128710da23966a1d5f4b2cbcca0ccb63c4d0f1.tar.gz
build: Take advantage of has_function argument
Since meson 0.50.0, the `find_library` method can be used to verify if the library's headers or functions are present[0]. The `has_function` argument has been used to check the `socketpair` function in the `socket` library. [0] http://mesonbuild.com/Release-notes-for-0-50-0.html#find-library-with-its-headers
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build14
1 files changed, 7 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 50b753b4..541ab708 100644
--- a/meson.build
+++ b/meson.build
@@ -65,14 +65,14 @@ have_socketpair = cc.has_function('socketpair')
socket_deps = []
if not have_socketpair
- socket_dep = cc.find_library('socket', required: false)
- have_socketpair = socket_dep.found() and cc.has_function('socketpair', dependencies: socket_dep)
-
- if have_socketpair
- socket_deps += socket_dep
- endif
+ socket_dep = cc.find_library(
+ 'socket',
+ has_function: 'socketpair',
+ required: false,
+ )
+ socket_deps += socket_dep
+ have_socketpair = socket_dep.found()
endif
-
config_h.set('HAVE_SOCKETPAIR', have_socketpair,
description: 'Define if you have the socketpair function.')