Rename GetLanguageInfo to GetLanguageSpecificData (#117012)
[llvm-project.git] / clang / lib / DirectoryWatcher / CMakeLists.txt
blob5a87969821138352f4f408a158d77d1a09fa1b67
1 include(CheckIncludeFiles)
3 set(LLVM_LINK_COMPONENTS support)
5 set(DIRECTORY_WATCHER_SOURCES DirectoryScanner.cpp)
6 set(DIRECTORY_WATCHER_LINK_LIBS "")
8 if(APPLE)
9   check_include_files("CoreServices/CoreServices.h" HAVE_CORESERVICES)
10   if(HAVE_CORESERVICES)
11     list(APPEND DIRECTORY_WATCHER_SOURCES mac/DirectoryWatcher-mac.cpp)
12     set(DIRECTORY_WATCHER_LINK_LIBS "-framework CoreServices")
13   endif()
14 elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
15   check_include_files("sys/inotify.h" HAVE_INOTIFY)
16   if(HAVE_INOTIFY)
17     list(APPEND DIRECTORY_WATCHER_SOURCES linux/DirectoryWatcher-linux.cpp)
18     find_package(Threads REQUIRED)
19   endif()
20 elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
21   list(APPEND DIRECTORY_WATCHER_SOURCES windows/DirectoryWatcher-windows.cpp)
22 else()
23   list(APPEND DIRECTORY_WATCHER_SOURCES default/DirectoryWatcher-not-implemented.cpp)
24 endif()
26 add_clang_library(clangDirectoryWatcher
27   ${DIRECTORY_WATCHER_SOURCES}
28   )
30 target_link_libraries(clangDirectoryWatcher PUBLIC ${CMAKE_THREAD_LIBS_INIT})
31 target_link_libraries(clangDirectoryWatcher PRIVATE ${DIRECTORY_WATCHER_LINK_LIBS})