Browse Source

Add Mac and Windows file watcher monitor.

tags/v1.1.1
Andrew Belt 5 years ago
parent
commit
bbbe733f31
2 changed files with 8 additions and 4 deletions
  1. +3
    -3
      Makefile
  2. +5
    -1
      src/Prototype.cpp

+ 3
- 3
Makefile View File

@@ -17,9 +17,9 @@ fswatch := dep/lib/libfswatch.a
DEPS += $(fswatch)
OBJECTS += $(fswatch)
$(fswatch):
cd dep && $(WGET) "https://github.com/emcrisostomo/fswatch/releases/download/1.14.0/fswatch-1.14.0.tar.gz"
cd dep && $(SHA256) fswatch-1.14.0.tar.gz 44d5707adc0e46d901ba95a5dc35c5cc282bd6f331fcf9dbf9fad4af0ed5b29d
cd dep && $(UNTAR) fswatch-1.14.0.tar.gz
cd $(WGET) "https://github.com/emcrisostomo/fswatch/releases/download/1.14.0/fswatch-1.14.0.tar.gz"
cd $(SHA256) fswatch-1.14.0.tar.gz 44d5707adc0e46d901ba95a5dc35c5cc282bd6f331fcf9dbf9fad4af0ed5b29d
cd dep && $(UNTAR) ../fswatch-1.14.0.tar.gz
cd dep/fswatch-1.14.0 && $(CONFIGURE) --enable-shared=no
cd dep/fswatch-1.14.0 && $(MAKE)
cd dep/fswatch-1.14.0 && $(MAKE) install


+ 5
- 1
src/Prototype.cpp View File

@@ -147,8 +147,12 @@ struct Prototype : Module {
// Watch file
FSW_STATUS err = fsw_init_library();
if (err == FSW_OK) {
#ifdef ARCH_LIN
#if defined ARCH_LIN
fsw_monitor_type type = inotify_monitor_type;
#elif defined ARCH_MAC
fsw_monitor_type type = fsevents_monitor_type;
#elif defined ARCH_WIN
fsw_monitor_type type = windows_monitor_type;
#endif
fsw = fsw_init_session(type);
fsw_add_path(fsw, this->path.c_str());


Loading…
Cancel
Save