aboutsummaryrefslogtreecommitdiff
path: root/dep/efsw/CMakeLists.txt
diff options
context:
space:
mode:
authordaMaex <damaex@live.de>2019-11-05 18:38:30 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-19 00:01:13 +0100
commit97d48751b0192533f2d7b325d1b9a5dabf99ae73 (patch)
treea77047339244bf29a80a86f9f899496d86463893 /dep/efsw/CMakeLists.txt
parentdbf347bdd02d2fe897274667d7f76c497293229d (diff)
Dep/efsw: updated efsw to newest version (#23894)
(cherry picked from commit ed2c2941a74ec720c5e4db3cb33367235e6c3655)
Diffstat (limited to 'dep/efsw/CMakeLists.txt')
-rw-r--r--dep/efsw/CMakeLists.txt62
1 files changed, 32 insertions, 30 deletions
diff --git a/dep/efsw/CMakeLists.txt b/dep/efsw/CMakeLists.txt
index b37e5021e0a..03f6c153115 100644
--- a/dep/efsw/CMakeLists.txt
+++ b/dep/efsw/CMakeLists.txt
@@ -18,50 +18,48 @@ if (BUILD_SHARED_LIBS)
src/efsw/Watcher.cpp
src/efsw/WatcherGeneric.cpp)
- if(WIN32)
- list(APPEND SRCS
+ if (WIN32)
+ list (APPEND SRCS
src/efsw/platform/win/FileSystemImpl.cpp
src/efsw/platform/win/MutexImpl.cpp
src/efsw/platform/win/SystemImpl.cpp
src/efsw/platform/win/ThreadImpl.cpp)
- else()
- list(APPEND SRCS
+ else ()
+ list (APPEND SRCS
src/efsw/platform/posix/FileSystemImpl.cpp
src/efsw/platform/posix/MutexImpl.cpp
src/efsw/platform/posix/SystemImpl.cpp
src/efsw/platform/posix/ThreadImpl.cpp)
endif()
- if (WIN32)
- list(APPEND SRCS
- src/efsw/WatcherWin32.cpp
- src/efsw/FileWatcherWin32.cpp)
+ if (APPLE)
+ list (APPEND SRCS
+ src/efsw/FileWatcherFSEvents.cpp
+ src/efsw/FileWatcherKqueue.cpp
+ src/efsw/WatcherFSEvents.cpp
+ src/efsw/WatcherKqueue.cpp)
+
+ exec_program(uname ARGS -v OUTPUT_VARIABLE OSX_VERSION)
+ string(REGEX MATCH "[0-9]+" OSX_VERSION ${OSX_VERSION})
+ if (NOT OSX_VERSION GREATER 9)
+ set(OPTIONAL_COMPILE_DEFINITIONS "-DEFSW_FSEVENTS_NOT_SUPPORTED")
+ endif()
+ set(OPTIONAL_LINK_LIBRARIES "-framework CoreFoundation" "-framework CoreServices")
+ elseif (WIN32)
+ list (APPEND SRCS
+ src/efsw/FileWatcherWin32.cpp
+ src/efsw/WatcherWin32.cpp)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- list(APPEND SRCS
+ list (APPEND SRCS
src/efsw/FileWatcherInotify.cpp
src/efsw/WatcherInotify.cpp)
-
if (NOT EXISTS "/usr/include/sys/inotify.h" AND NOT EXISTS "/usr/local/include/sys/inotify.h")
- add_definitions(-DEFSW_INOTIFY_NOSYS)
+ set(OPTIONAL_COMPILE_DEFINITIONS "-DEFSW_INOTIFY_NOSYS")
endif()
- elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR APPLE)
- list(APPEND SRCS
+ elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ list (APPEND SRCS
src/efsw/FileWatcherKqueue.cpp
src/efsw/WatcherKqueue.cpp)
-
- if (APPLE)
- list(APPEND SRCS
- src/efsw/FileWatcherFSEvents.cpp
- src/efsw/WatcherFSEvents.cpp)
-
- exec_program(uname ARGS -v OUTPUT_VARIABLE OSX_VERSION)
- string(REGEX MATCH "[0-9]+" OSX_VERSION ${OSX_VERSION})
- if (NOT OSX_VERSION GREATER 9)
- add_definitions(-DEFSW_FSEVENTS_NOT_SUPPORTED)
- endif()
-
- set(OPTIONAL_MAC_LINK_LIBRARIES "-framework CoreFoundation" "-framework CoreServices")
- endif()
endif()
add_library(efsw STATIC ${SRCS})
@@ -72,17 +70,21 @@ if (BUILD_SHARED_LIBS)
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src)
+ target_compile_definitions(efsw
+ PRIVATE
+ ${OPTIONAL_COMPILE_DEFINITIONS})
+
target_link_libraries(efsw
PRIVATE
trinity-dependency-interface
PUBLIC
threads
- ${OPTIONAL_MAC_LINK_LIBRARIES})
+ ${OPTIONAL_LINK_LIBRARIES})
set_target_properties(efsw
PROPERTIES
FOLDER
"dep")
-else()
+else ()
add_library(efsw INTERFACE IMPORTED GLOBAL)
-endif()
+endif ()