]> git.ipfire.org Git - thirdparty/git.git/commitdiff
compat/fsmonitor/fsm-listen-darwin: stub in backend for Darwin
authorJeff Hostetler <jeffhost@microsoft.com>
Fri, 25 Mar 2022 18:02:52 +0000 (18:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Mar 2022 23:04:15 +0000 (16:04 -0700)
Stub in empty implementation of fsmonitor--daemon
backend for Darwin (aka MacOS).

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/fsmonitor/fsm-listen-darwin.c [new file with mode: 0644]
config.mak.uname
contrib/buildsystems/CMakeLists.txt

diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
new file mode 100644 (file)
index 0000000..c84e334
--- /dev/null
@@ -0,0 +1,20 @@
+#include "cache.h"
+#include "fsmonitor.h"
+#include "fsm-listen.h"
+
+int fsm_listen__ctor(struct fsmonitor_daemon_state *state)
+{
+       return -1;
+}
+
+void fsm_listen__dtor(struct fsmonitor_daemon_state *state)
+{
+}
+
+void fsm_listen__stop_async(struct fsmonitor_daemon_state *state)
+{
+}
+
+void fsm_listen__loop(struct fsmonitor_daemon_state *state)
+{
+}
index 26074f56bedb3d84387a43a039f95abeea98be1b..501970902da186fdbc2812a3b39f5fcb8a889b5b 100644 (file)
@@ -157,6 +157,16 @@ ifeq ($(uname_S),Darwin)
                        MSGFMT = /usr/local/opt/gettext/bin/msgfmt
                endif
        endif
+
+       # The builtin FSMonitor on MacOS builds upon Simple-IPC.  Both require
+       # Unix domain sockets and PThreads.
+       ifndef NO_PTHREADS
+       ifndef NO_UNIX_SOCKETS
+       FSMONITOR_DAEMON_BACKEND = darwin
+       endif
+       endif
+
+       BASIC_LDFLAGS += -framework CoreServices
 endif
 ifeq ($(uname_S),SunOS)
        NEEDS_SOCKET = YesPlease
index 0963629db7f93476c2f7e52d6d76718427f53557..ee0d7257b770992539b248df6106fdc90c17b848 100644 (file)
@@ -289,6 +289,9 @@ if(SUPPORTS_SIMPLE_IPC)
        if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
                add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND)
                list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-win32.c)
+       elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+               add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND)
+               list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-darwin.c)
        endif()
 endif()