@@ -103,72 +103,77 @@ add_executable(yue
103103 src/yue.cpp
104104)
105105
106- target_sources (yue PRIVATE
107- src/3rdParty/efsw/Debug.cpp
108- src/3rdParty/efsw/DirectorySnapshot.cpp
109- src/3rdParty/efsw/DirectorySnapshotDiff.cpp
110- src/3rdParty/efsw/DirWatcherGeneric.cpp
111- src/3rdParty/efsw/FileInfo.cpp
112- src/3rdParty/efsw/FileSystem.cpp
113- src/3rdParty/efsw/FileWatcher.cpp
114- src/3rdParty/efsw/FileWatcherCWrapper.cpp
115- src/3rdParty/efsw/FileWatcherGeneric.cpp
116- src/3rdParty/efsw/FileWatcherImpl.cpp
117- src/3rdParty/efsw/Log.cpp
118- src/3rdParty/efsw/Mutex.cpp
119- src/3rdParty/efsw/String.cpp
120- src/3rdParty/efsw/System.cpp
121- src/3rdParty/efsw/Thread.cpp
122- src/3rdParty/efsw/Watcher.cpp
123- src/3rdParty/efsw/WatcherGeneric.cpp
124- )
125-
126- if (WIN32 )
127- target_sources (yue PRIVATE
128- src/3rdParty/efsw/platform/win/FileSystemImpl.cpp
129- src/3rdParty/efsw/platform/win/MutexImpl.cpp
130- src/3rdParty/efsw/platform/win/SystemImpl.cpp
131- src/3rdParty/efsw/platform/win/ThreadImpl.cpp
132- )
133- else ()
134- target_sources (yue PRIVATE
135- src/3rdParty/efsw/platform/posix/FileSystemImpl.cpp
136- src/3rdParty/efsw/platform/posix/MutexImpl.cpp
137- src/3rdParty/efsw/platform/posix/SystemImpl.cpp
138- src/3rdParty/efsw/platform/posix/ThreadImpl.cpp
139- )
140- endif ()
141-
142- if (APPLE )
106+ # Add efsw sources only if not in Termux environment
107+ if (NOT IS_TERMUX)
143108 target_sources (yue PRIVATE
144- src/3rdParty/efsw/FileWatcherFSEvents.cpp
145- src/3rdParty/efsw/FileWatcherKqueue.cpp
146- src/3rdParty/efsw/WatcherFSEvents.cpp
147- src/3rdParty/efsw/WatcherKqueue.cpp
109+ src/3rdParty/efsw/Debug.cpp
110+ src/3rdParty/efsw/DirectorySnapshot.cpp
111+ src/3rdParty/efsw/DirectorySnapshotDiff.cpp
112+ src/3rdParty/efsw/DirWatcherGeneric.cpp
113+ src/3rdParty/efsw/FileInfo.cpp
114+ src/3rdParty/efsw/FileSystem.cpp
115+ src/3rdParty/efsw/FileWatcher.cpp
116+ src/3rdParty/efsw/FileWatcherCWrapper.cpp
117+ src/3rdParty/efsw/FileWatcherGeneric.cpp
118+ src/3rdParty/efsw/FileWatcherImpl.cpp
119+ src/3rdParty/efsw/Log.cpp
120+ src/3rdParty/efsw/Mutex.cpp
121+ src/3rdParty/efsw/String.cpp
122+ src/3rdParty/efsw/System.cpp
123+ src/3rdParty/efsw/Thread.cpp
124+ src/3rdParty/efsw/Watcher.cpp
125+ src/3rdParty/efsw/WatcherGeneric.cpp
148126 )
149127
150- if (NOT CMAKE_SYSTEM_VERSION GREATER 9)
151- target_compile_definitions (yue PRIVATE EFSW_FSEVENTS_NOT_SUPPORTED )
128+ if (WIN32 )
129+ target_sources (yue PRIVATE
130+ src/3rdParty/efsw/platform/win/FileSystemImpl.cpp
131+ src/3rdParty/efsw/platform/win/MutexImpl.cpp
132+ src/3rdParty/efsw/platform/win/SystemImpl.cpp
133+ src/3rdParty/efsw/platform/win/ThreadImpl.cpp
134+ )
135+ else ()
136+ target_sources (yue PRIVATE
137+ src/3rdParty/efsw/platform/posix/FileSystemImpl.cpp
138+ src/3rdParty/efsw/platform/posix/MutexImpl.cpp
139+ src/3rdParty/efsw/platform/posix/SystemImpl.cpp
140+ src/3rdParty/efsw/platform/posix/ThreadImpl.cpp
141+ )
152142 endif ()
153- elseif (WIN32 )
154- target_sources (yue PRIVATE
155- src/3rdParty/efsw/FileWatcherWin32.cpp
156- src/3rdParty/efsw/WatcherWin32.cpp
157- )
158- elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
159- target_sources (yue PRIVATE
160- src/3rdParty/efsw/FileWatcherInotify.cpp
161- src/3rdParty/efsw/WatcherInotify.cpp
162- )
163143
164- if (NOT EXISTS "/usr/include/sys/inotify.h" AND NOT EXISTS "/usr/local/include/sys/inotify.h" )
165- target_compile_definitions (yue PRIVATE EFSW_INOTIFY_NOSYS )
144+ if (APPLE )
145+ target_sources (yue PRIVATE
146+ src/3rdParty/efsw/FileWatcherFSEvents.cpp
147+ src/3rdParty/efsw/FileWatcherKqueue.cpp
148+ src/3rdParty/efsw/WatcherFSEvents.cpp
149+ src/3rdParty/efsw/WatcherKqueue.cpp
150+ )
151+
152+ if (NOT CMAKE_SYSTEM_VERSION GREATER 9)
153+ target_compile_definitions (yue PRIVATE EFSW_FSEVENTS_NOT_SUPPORTED )
154+ endif ()
155+ elseif (WIN32 )
156+ target_sources (yue PRIVATE
157+ src/3rdParty/efsw/FileWatcherWin32.cpp
158+ src/3rdParty/efsw/WatcherWin32.cpp
159+ )
160+ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
161+ target_sources (yue PRIVATE
162+ src/3rdParty/efsw/FileWatcherInotify.cpp
163+ src/3rdParty/efsw/WatcherInotify.cpp
164+ )
165+
166+ if (NOT EXISTS "/usr/include/sys/inotify.h" AND NOT EXISTS "/usr/local/include/sys/inotify.h" )
167+ target_compile_definitions (yue PRIVATE EFSW_INOTIFY_NOSYS )
168+ endif ()
169+ elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" )
170+ target_sources (yue PRIVATE
171+ src/3rdParty/efsw/FileWatcherKqueue.cpp
172+ src/3rdParty/efsw/WatcherKqueue.cpp
173+ )
166174 endif ()
167- elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" )
168- target_sources (yue PRIVATE
169- src/3rdParty/efsw/FileWatcherKqueue.cpp
170- src/3rdParty/efsw/WatcherKqueue.cpp
171- )
175+ else ()
176+ message (STATUS "Termux environment detected: excluding efsw file watcher sources" )
172177endif ()
173178
174179if (MSVC )
@@ -203,4 +208,3 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
203208endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
204209
205210install (CODE "" )
206-
0 commit comments