include(CheckIncludeFiles)

set(LLVM_LINK_COMPONENTS support)

add_clang_library(clangDirectoryWatcher
  DirectoryWatcher.cpp
  )

if(BUILD_SHARED_LIBS)
  if(APPLE)
    check_include_files("CoreServices/CoreServices.h" HAVE_CORESERVICES_H)
    if(HAVE_CORESERVICES_H)
      set(DIRECTORY_WATCHER_FLAGS "${DIRECTORY_WATCHER_FLAGS} -framework CoreServices")
    endif()
    set_property(TARGET clangDirectoryWatcher APPEND_STRING PROPERTY
                 LINK_FLAGS ${DIRECTORY_WATCHER_FLAGS})
  endif()
endif()

include(CheckIncludeFiles)

set(LLVM_LINK_COMPONENTS support)

add_clang_library(clangDirectoryWatcher
  DirectoryWatcher.cpp
  )

if(APPLE)
  check_include_files("CoreServices/CoreServices.h" HAVE_CORESERVICES_H)
  if(HAVE_CORESERVICES_H)
    target_link_libraries(clangDirectoryWatcher PRIVATE "-framework CoreServices")
  endif()
endif()

Fix libclang build for upstream-with-swift.
[DirectoryWatcher] Fix libclang build for upstream-with-swift.
