# HG changeset patch # User Paper # Date 1762558578 18000 # Node ID d859306e2db4f297c805aaecf34d71d9772892af # Parent 2f89797b6a445b930abf4324c410a867b651e3e6 filesystem: actually check for inotify instead of blindly assuming it exists diff -r 2f89797b6a44 -r d859306e2db4 CMakeLists.txt --- a/CMakeLists.txt Fri Nov 07 18:28:36 2025 -0500 +++ b/CMakeLists.txt Fri Nov 07 18:36:18 2025 -0500 @@ -274,6 +274,8 @@ ) list(APPEND DEFINES WIN32) else() + include(CheckSymbolExists) + find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(GLIB gio-2.0 glib-2.0) @@ -292,6 +294,15 @@ list(APPEND DEFINES HAVE_XCB) endif() endif() + + check_symbol_exists(inotify_init1 "sys/inotify.h" HAVE_INOTIFY_INIT1) + if(HAVE_INOTIFY_INIT1) + list(APPEND DEFINES HAVE_INOTIFY_INIT1) + endif() + check_symbol_exists(inotify_init "sys/inotify.h" HAVE_INOTIFY) + if(HAVE_INOTIFY) + list(APPEND DEFINES HAVE_INOTIFY) + endif() endif() ########################################################################### diff -r 2f89797b6a44 -r d859306e2db4 src/core/filesystem.cc --- a/src/core/filesystem.cc Fri Nov 07 18:28:36 2025 -0500 +++ b/src/core/filesystem.cc Fri Nov 07 18:36:18 2025 -0500 @@ -8,7 +8,7 @@ #ifdef WIN32 # include -#elif defined(linux) +#elif defined(HAVE_INOTIFY) /* ehhhh */ # include # include @@ -368,7 +368,7 @@ }; using DefaultWatcher = Win32WatcherVista; -#elif defined(__linux__) +#elif defined(HAVE_INOTIFY) /* Inotify watcher */ class InotifyWatcher : public StdFilesystemWatcher { public: