From 7d876f81ad7fa283fa7cf6e24cc17b128f7d32ec Mon Sep 17 00:00:00 2001 From: Guldoman Date: Fri, 17 May 2024 17:19:39 +0200 Subject: [PATCH] build: fix dirmonitor backend selection (#1790) When a backend was specified using meson, the relative source files weren't being added. --- src/meson.build | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/meson.build b/src/meson.build index 501914c8..abf512cb 100644 --- a/src/meson.build +++ b/src/meson.build @@ -16,41 +16,45 @@ lite_sources += 'api/dirmonitor.c' if get_option('dirmonitor_backend') == '' if cc.has_function('inotify_init', prefix : '#include') dirmonitor_backend = 'inotify' - lite_sources += 'api/dirmonitor/inotify.c' elif host_machine.system() == 'darwin' and cc.check_header('CoreServices/CoreServices.h') dirmonitor_backend = 'fsevents' - lite_sources += 'api/dirmonitor/fsevents.c' elif cc.has_function('kqueue', prefix : '#include') dirmonitor_backend = 'kqueue' - lite_sources += 'api/dirmonitor/kqueue.c' elif cc.has_function('create_inode_watcher', prefix : '#include') dirmonitor_backend = 'inodewatcher' - add_languages('cpp') - lite_sources += 'api/dirmonitor/inodewatcher.cpp' elif dependency('libkqueue', required : false).found() dirmonitor_backend = 'kqueue' - lite_sources += 'api/dirmonitor/kqueue.c' elif host_machine.system() == 'windows' dirmonitor_backend = 'win32' - lite_sources += 'api/dirmonitor/win32.c' else dirmonitor_backend = 'dummy' - lite_sources += 'api/dirmonitor/dummy.c' warning('no suitable backend found, defaulting to dummy backend') endif else dirmonitor_backend = get_option('dirmonitor_backend') endif -message('dirmonitor_backend: @0@'.format(dirmonitor_backend)) - -if dirmonitor_backend == 'kqueue' +if dirmonitor_backend == 'inotify' + lite_sources += 'api/dirmonitor/inotify.c' +elif dirmonitor_backend == 'fsevents' + lite_sources += 'api/dirmonitor/fsevents.c' +elif dirmonitor_backend == 'kqueue' + lite_sources += 'api/dirmonitor/kqueue.c' libkqueue_dep = dependency('libkqueue', required : false) if libkqueue_dep.found() lite_deps += libkqueue_dep endif +elif dirmonitor_backend == 'inodewatcher' + add_languages('cpp') + lite_sources += 'api/dirmonitor/inodewatcher.cpp' +elif dirmonitor_backend == 'win32' + lite_sources += 'api/dirmonitor/win32.c' +else + lite_sources += 'api/dirmonitor/dummy.c' endif +message('dirmonitor_backend: @0@'.format(dirmonitor_backend)) + lite_rc = [] if host_machine.system() == 'windows' windows = import('windows')