Skip to content

Commit

Permalink
Update fsevents fix for legacy macOS (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 authored Nov 17, 2024
1 parent 107703d commit 72f5d0b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
22 changes: 15 additions & 7 deletions cmake/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
include(CMakeFindDependencyMacro)

if(APPLE)
option(USE_LIBSECRET "Use libsecret on macOS instead of Apple keychain" OFF)
endif()

if(DEFINED ENV{VCPKG_ROOT})
file(TO_CMAKE_PATH $ENV{VCPKG_ROOT} VCPKG_ROOT)
if(EXISTS "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
Expand All @@ -18,7 +22,10 @@ if(USING_VCPKG)
endif()
if(WIN32)
find_dependency(sqlcipher CONFIG REQUIRED)
elseif(LINUX)
elseif(APPLE)
find_library(CF_LIBRARY CoreFoundation)
find_library(CS_LIBRARY CoreServices)
find_library(IOKIT_LIBRARY IOKit)
find_dependency(Threads REQUIRED)
find_dependency(OpenSSL REQUIRED)
find_dependency(PkgConfig REQUIRED)
Expand All @@ -27,12 +34,12 @@ elseif(LINUX)
pkg_check_modules(gmodule REQUIRED IMPORTED_TARGET gmodule-2.0)
pkg_check_modules(gobject REQUIRED IMPORTED_TARGET gobject-2.0)
pkg_check_modules(gthread REQUIRED IMPORTED_TARGET gthread-2.0)
pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1)
elseif(APPLE)
find_library(CF_LIBRARY CoreFoundation)
find_library(CS_LIBRARY CoreServices)
find_library(IOKIT_LIBRARY IOKit)
find_library(SECURITY_LIBRARY Security)
if(USE_LIBSECRET)
pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1)
else()
find_library(SECURITY_LIBRARY Security)
endif()
else()
find_dependency(Threads REQUIRED)
find_dependency(OpenSSL REQUIRED)
find_dependency(PkgConfig REQUIRED)
Expand All @@ -41,6 +48,7 @@ elseif(APPLE)
pkg_check_modules(gmodule REQUIRED IMPORTED_TARGET gmodule-2.0)
pkg_check_modules(gobject REQUIRED IMPORTED_TARGET gobject-2.0)
pkg_check_modules(gthread REQUIRED IMPORTED_TARGET gthread-2.0)
pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1)
endif()

check_required_components(libnick)
10 changes: 5 additions & 5 deletions src/filesystem/filesystemwatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

#ifdef __APPLE__
#include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
// Only available in 10.7+
#define kFSEventStreamCreateFlagFileEvents 0x00000010
#define kFSEventStreamEventFlagItemCreated 0x00000100
#define kFSEventStreamEventFlagItemRemoved 0x00000200
#define kFSEventStreamEventFlagItemRenamed 0x00000800
FSEventStreamCreateFlags kFSEventStreamCreateFlagFileEvents = 0x00000010;
FSEventStreamEventFlags kFSEventStreamEventFlagItemCreated = 0x00000100;
FSEventStreamEventFlags kFSEventStreamEventFlagItemRemoved = 0x00000200;
FSEventStreamEventFlags kFSEventStreamEventFlagItemRenamed = 0x00000800;
#endif
#endif

Expand Down

0 comments on commit 72f5d0b

Please sign in to comment.