diff options
| author | Li Jin <dragon-fly@qq.com> | 2025-11-04 10:09:55 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2025-11-04 10:09:55 +0800 |
| commit | 03d4fad6ef79ce1788391648e535039a5f29aec3 (patch) | |
| tree | 3b2765d972ad2b773eea539d73dedcc3cded1bd8 | |
| parent | b6423d2d81ca0867570bf8ff021c30205cb7fd57 (diff) | |
| download | yuescript-03d4fad6ef79ce1788391648e535039a5f29aec3.tar.gz yuescript-03d4fad6ef79ce1788391648e535039a5f29aec3.tar.bz2 yuescript-03d4fad6ef79ce1788391648e535039a5f29aec3.zip | |
Excluding esfw related codes for Termux compilation.
| -rw-r--r-- | CMakeLists.txt | 126 |
1 files changed, 65 insertions, 61 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d155b1..7c0293b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -103,72 +103,77 @@ add_executable(yue | |||
| 103 | src/yue.cpp | 103 | src/yue.cpp |
| 104 | ) | 104 | ) |
| 105 | 105 | ||
| 106 | target_sources(yue PRIVATE | 106 | # Add efsw sources only if not in Termux environment |
| 107 | src/3rdParty/efsw/Debug.cpp | 107 | if (NOT IS_TERMUX) |
| 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) | ||
| 143 | target_sources(yue PRIVATE | 108 | target_sources(yue PRIVATE |
| 144 | src/3rdParty/efsw/FileWatcherFSEvents.cpp | 109 | src/3rdParty/efsw/Debug.cpp |
| 145 | src/3rdParty/efsw/FileWatcherKqueue.cpp | 110 | src/3rdParty/efsw/DirectorySnapshot.cpp |
| 146 | src/3rdParty/efsw/WatcherFSEvents.cpp | 111 | src/3rdParty/efsw/DirectorySnapshotDiff.cpp |
| 147 | src/3rdParty/efsw/WatcherKqueue.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 | ||
| 148 | ) | 126 | ) |
| 149 | 127 | ||
| 150 | if (NOT CMAKE_SYSTEM_VERSION GREATER 9) | 128 | if (WIN32) |
| 151 | target_compile_definitions(yue PRIVATE EFSW_FSEVENTS_NOT_SUPPORTED) | 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 | ) | ||
| 152 | endif() | 142 | 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 | ) | ||
| 163 | 143 | ||
| 164 | if (NOT EXISTS "/usr/include/sys/inotify.h" AND NOT EXISTS "/usr/local/include/sys/inotify.h") | 144 | if (APPLE) |
| 165 | target_compile_definitions(yue PRIVATE EFSW_INOTIFY_NOSYS) | 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 | ) | ||
| 166 | endif() | 174 | endif() |
| 167 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") | 175 | else() |
| 168 | target_sources(yue PRIVATE | 176 | message(STATUS "Termux environment detected: excluding efsw file watcher sources") |
| 169 | src/3rdParty/efsw/FileWatcherKqueue.cpp | ||
| 170 | src/3rdParty/efsw/WatcherKqueue.cpp | ||
| 171 | ) | ||
| 172 | endif() | 177 | endif() |
| 173 | 178 | ||
| 174 | if (MSVC) | 179 | if (MSVC) |
| @@ -203,4 +208,3 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | |||
| 203 | endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | 208 | endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
| 204 | 209 | ||
| 205 | install(CODE "") | 210 | install(CODE "") |
| 206 | |||
