source_set("sources") {
  include_dirs = [ "//Userland/Libraries" ]
  deps = [ "//AK" ]
  sources = [
    "AnonymousBuffer.cpp",
    "AnonymousBuffer.h",
    "ArgsParser.cpp",
    "ArgsParser.h",
    "Command.cpp",
    "Command.h",
    "ConfigFile.cpp",
    "ConfigFile.h",
    "DateTime.cpp",
    "DateTime.h",
    "Debounce.h",
    "DeferredInvocationContext.h",
    "DirIterator.cpp",
    "DirIterator.h",
    "Directory.cpp",
    "Directory.h",
    "DirectoryEntry.cpp",
    "DirectoryEntry.h",
    "ElapsedTimer.cpp",
    "ElapsedTimer.h",
    "Event.cpp",
    "Event.h",
    "EventLoop.cpp",
    "EventLoop.h",
    "EventLoopImplementation.cpp",
    "EventLoopImplementation.h",
    "EventLoopImplementationUnix.cpp",
    "EventLoopImplementationUnix.h",
    "File.cpp",
    "File.h",
    "Forward.h",
    "LockFile.cpp",
    "LockFile.h",
    "MappedFile.cpp",
    "MappedFile.h",
    "MimeData.cpp",
    "MimeData.h",
    "NetworkJob.cpp",
    "NetworkJob.h",
    "NetworkResponse.h",
    "Notifier.cpp",
    "Notifier.h",
    "Object.cpp",
    "Object.h",
    "Process.cpp",
    "Process.h",
    "ProcessStatisticsReader.cpp",
    "ProcessStatisticsReader.h",
    "Promise.h",
    "Property.cpp",
    "Property.h",
    "Proxy.h",
    "SOCKSProxyClient.cpp",
    "SOCKSProxyClient.h",
    "SecretString.cpp",
    "SecretString.h",
    "SessionManagement.cpp",
    "SessionManagement.h",
    "SharedCircularQueue.h",
    "Socket.cpp",
    "Socket.h",
    "SocketAddress.h",
    "StandardPaths.cpp",
    "StandardPaths.h",
    "System.cpp",
    "System.h",
    "SystemServerTakeover.cpp",
    "SystemServerTakeover.h",
    "TCPServer.cpp",
    "TCPServer.h",
    "ThreadEventQueue.cpp",
    "ThreadEventQueue.h",
    "Timer.cpp",
    "Timer.h",
    "UDPServer.cpp",
    "UDPServer.h",
    "UmaskScope.h",
    "Version.cpp",
    "Version.h",
  ]
  if (current_os != "android") {
    sources += [
      "Account.cpp",
      "Account.h",
      "FilePermissionsMask.cpp",
      "FilePermissionsMask.h",
      "GetPassword.cpp",
      "GetPassword.h",
      "Group.cpp",
      "Group.h",
      "LocalServer.cpp",
      "LocalServer.h",
    ]
  }
}

source_set("filewatcher") {
  include_dirs = [ "//Userland/Libraries" ]
  sources = [ "FileWatcher.h" ]
  deps = [ "//AK" ]
  frameworks = []
  if (current_os == "linux") {
    sources += [ "FileWatcherLinux.cpp" ]
  } else if (current_os == "mac") {
    sources += [ "FileWatcherMacOS.mm" ]
    frameworks += [
      "CoreFoundation.framework",
      "CoreServices.framework",
      "Foundation.framework",
    ]
  } else if (current_os == "serenity") {
    sources += [ "FileWatcherSerenity.cpp" ]
  } else {
    sources += [ "FileWatcherUnimplemented.cpp" ]
  }
}

shared_library("LibCore") {
  libs = []

  if (current_os == "linux" || current_os == "android") {
    libs += [ "dl" ]
  }
  if (current_os == "linux") {
    libs += [ "rt" ]
  }

  output_name = "core"

  deps = [
    ":filewatcher",
    ":sources",
    "//AK:sources",
    "//Meta/gn/build/libs/crypt",
    "//Meta/gn/build/libs/pthread",
    "//Userland/Libraries/LibSystem",
  ]
}
