| 1 |
README.windows |
| 2 |
************** |
| 3 |
|
| 4 |
Introduction |
| 5 |
============ |
| 6 |
|
| 7 |
This file describes the steps required to build fswatch on Windows. fswatch was |
| 8 |
born as a POSIX application, but Windows builds are supported through the native |
| 9 |
Windows monitor based on ReadDirectoryChangesW. |
| 10 |
|
| 11 |
The recommended Windows build environment is MSYS2 with a MinGW-w64 toolchain. |
| 12 |
Cygwin compatibility is kept on a best-effort basis for users who need a POSIX |
| 13 |
environment on Windows, but Cygwin is not required to build fswatch on Windows. |
| 14 |
|
| 15 |
Windows has historically provided multiple versions of the same API for single |
| 16 |
byte and multibyte character sets. We have decided to only support the |
| 17 |
multibyte API: the Windows monitor will thus not build on Windows system |
| 18 |
supporting only the single-byte APIs. In this case, the only available monitor |
| 19 |
on the Windows OS will be the poll monitor. |
| 20 |
|
| 21 |
MSYS2/MinGW |
| 22 |
=========== |
| 23 |
|
| 24 |
MSYS2 is the recommended environment to build fswatch on Windows. It provides |
| 25 |
the MinGW-w64 native Windows toolchain, build tools, and libraries through the |
| 26 |
pacman package manager: |
| 27 |
|
| 28 |
https://www.msys2.org |
| 29 |
|
| 30 |
For a CMake build, install the MinGW-w64 compiler, CMake, and Ninja packages |
| 31 |
for the MSYS2 environment you intend to use. For example, in the UCRT64 |
| 32 |
environment: |
| 33 |
|
| 34 |
$ pacman -S --needed \ |
| 35 |
mingw-w64-ucrt-x86_64-cmake \ |
| 36 |
mingw-w64-ucrt-x86_64-gcc \ |
| 37 |
mingw-w64-ucrt-x86_64-ninja |
| 38 |
|
| 39 |
For the GNU Build System, install the corresponding compiler together with the |
| 40 |
Autoconf, Automake, libtool, make, and gettext packages required by the build. |
| 41 |
|
| 42 |
Cygwin |
| 43 |
====== |
| 44 |
|
| 45 |
Cygwin builds are supported on a best-effort basis. When configure detects the |
| 46 |
Cygwin headers and the cygwin_create_path API, fswatch uses them to translate |
| 47 |
between POSIX and Windows paths for the Windows monitor. The current Cygwin |
| 48 |
distribution can be downloaded at: |
| 49 |
|
| 50 |
https://cygwin.com |
| 51 |
|
| 52 |
Cygwin is a modular environment and the following components are required to |
| 53 |
build fswatch with the GNU Build System: |
| 54 |
|
| 55 |
* GNU GCC C++ compiler. |
| 56 |
|
| 57 |
* GNU Autoconf. |
| 58 |
|
| 59 |
* GNU Automake. |
| 60 |
|
| 61 |
* GNU Autoconf. |
| 62 |
|
| 63 |
* GNU libtool. |
| 64 |
|
| 65 |
The following are optional: |
| 66 |
|
| 67 |
* GNU gettext (optional) |
| 68 |
|
| 69 |
Windows Headers and Libraries |
| 70 |
============================= |
| 71 |
|
| 72 |
The Windows monitor requires Windows headers and libraries. MinGW-w64 provides |
| 73 |
compatible headers and import libraries when building through MSYS2. Other |
| 74 |
toolchains may require installing the Microsoft Windows SDK separately; consult |
| 75 |
your Windows toolchain documentation for the appropriate SDK version. |
| 76 |
|
| 77 |
GNU Build System |
| 78 |
================ |
| 79 |
|
| 80 |
For further instruction on building the GNU Build System from scratch, please |
| 81 |
check the README.gnu-build-system file. |
| 82 |
|
| 83 |
Localization and gettext |
| 84 |
======================== |
| 85 |
|
| 86 |
fswatch is localizable and locale support requires GNU gettext to be available |
| 87 |
at build time. |
| 88 |
|
| 89 |
Depending on gettext installation path, configure may not be able to find |
| 90 |
<libintl.h> or libintl. In this case, you will need to instruct configure about |
| 91 |
their location: |
| 92 |
|
| 93 |
$ CPPFLAGS="-I/path/to/include" LDFLAGS="-L/path/to/lib" ./configure |
| 94 |
|
| 95 |
If configure detects that gettext is available, you will find a message such as: |
| 96 |
|
| 97 |
checking whether to use NLS... yes |
| 98 |
|
| 99 |
or, which is equivalent, config.h will contain the following definition: |
| 100 |
|
| 101 |
#define ENABLE_NLS 1 |
| 102 |
|
| 103 |
----- |
| 104 |
|
| 105 |
Copyright (c) 2014-2026 Enrico M. Crisostomo |
| 106 |
|
| 107 |
This program is free software; you can redistribute it and/or modify it under |
| 108 |
the terms of the GNU General Public License as published by the Free Software |
| 109 |
Foundation; either version 3, or (at your option) any later version. |
| 110 |
|
| 111 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY |
| 112 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 113 |
PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 114 |
|
| 115 |
You should have received a copy of the GNU General Public License along with |
| 116 |
this program. If not, see <http://www.gnu.org/licenses/>. |