import("//Meta/gn/build/write_cmake_config.gni")

config("ak_headers") {
  include_dirs = [
    "//",
    "$root_gen_dir",
  ]
}

source_set("AK") {
  public_configs = [ ":ak_headers" ]
  public_deps = [ ":ak_debug_gen" ]

  # NOTE: Headers only!
  sources = [
    "AllOf.h",
    "AnyOf.h",
    "ArbitrarySizedEnum.h",
    "Array.h",
    "Assertions.h",
    "Atomic.h",
    "AtomicRefCounted.h",
    "Badge.h",
    "Base64.h",
    "BigIntBase.h",
    "BinaryBufferWriter.h",
    "BinaryHeap.h",
    "BinarySearch.h",
    "BitCast.h",
    "BitStream.h",
    "Bitmap.h",
    "BitmapView.h",
    "BufferedStream.h",
    "BuiltinWrappers.h",
    "BumpAllocator.h",
    "ByteBuffer.h",
    "ByteReader.h",
    "CharacterTypes.h",
    "Checked.h",
    "CheckedFormatString.h",
    "CircularBuffer.h",
    "CircularDeque.h",
    "CircularQueue.h",
    "Complex.h",
    "Concepts.h",
    "ConstrainedStream.h",
    "CountingStream.h",
    "DOSPackedTime.h",
    "DateConstants.h",
    "DefaultDelete.h",
    "Demangle.h",
    "DeprecatedFlyString.h",
    "DeprecatedString.h",
    "Diagnostics.h",
    "DisjointChunks.h",
    "DistinctNumeric.h",
    "DoublyLinkedList.h",
    "Endian.h",
    "EnumBits.h",
    "Error.h",
    "ExtraMathConstants.h",
    "FPControl.h",
    "Find.h",
    "FixedArray.h",
    "FixedPoint.h",
    "FloatingPoint.h",
    "FloatingPointStringConversions.h",
    "FlyString.h",
    "Format.h",
    "Forward.h",
    "Function.h",
    "FuzzyMatch.h",
    "GenericLexer.h",
    "GenericShorthands.h",
    "HashFunctions.h",
    "HashMap.h",
    "HashTable.h",
    "Hex.h",
    "IDAllocator.h",
    "IPv4Address.h",
    "IPv6Address.h",
    "InsertionSort.h",
    "IntegralMath.h",
    "IntrusiveDetails.h",
    "IntrusiveList.h",
    "IntrusiveListRelaxedConst.h",
    "IntrusiveRedBlackTree.h",
    "IterationDecision.h",
    "Iterator.h",
    "JsonArray.h",
    "JsonArraySerializer.h",
    "JsonObject.h",
    "JsonObjectSerializer.h",
    "JsonParser.h",
    "JsonPath.h",
    "JsonValue.h",
    "LEB128.h",
    "LexicalPath.h",
    "MACAddress.h",
    "Math.h",
    "MaybeOwned.h",
    "MemMem.h",
    "Memory.h",
    "MemoryStream.h",
    "NeverDestroyed.h",
    "NoAllocationGuard.h",
    "Noncopyable.h",
    "NonnullOwnPtr.h",
    "NonnullRefPtr.h",
    "NumberFormat.h",
    "NumericLimits.h",
    "OptionParser.h",
    "Optional.h",
    "OwnPtr.h",
    "Platform.h",
    "PrintfImplementation.h",
    "Ptr32.h",
    "Queue.h",
    "QuickSelect.h",
    "QuickSort.h",
    "Random.h",
    "RecursionDecision.h",
    "RedBlackTree.h",
    "RefCountForwarder.h",
    "RefCounted.h",
    "RefPtr.h",
    "Result.h",
    "ReverseIterator.h",
    "SIMD.h",
    "SIMDExtras.h",
    "SIMDMath.h",
    "ScopeGuard.h",
    "ScopeLogger.h",
    "ScopedValueRollback.h",
    "Singleton.h",
    "SinglyLinkedList.h",
    "SinglyLinkedListSizePolicy.h",
    "SourceGenerator.h",
    "SourceLocation.h",
    "Span.h",
    "Stack.h",
    "StackInfo.h",
    "Statistics.h",
    "StdLibExtraDetails.h",
    "StdLibExtras.h",
    "Stream.h",
    "String.h",
    "StringBuilder.h",
    "StringFloatingPointConversions.h",
    "StringHash.h",
    "StringImpl.h",
    "StringUtils.h",
    "StringView.h",
    "TemporaryChange.h",
    "Time.h",
    "Traits.h",
    "Trie.h",
    "Try.h",
    "Tuple.h",
    "TypeCasts.h",
    "TypeList.h",
    "TypedTransfer.h",
    "Types.h",
    "UBSanitizer.h",
    "UFixedBigInt.h",
    "UFixedBigIntDivision.h",
    "URL.h",
    "URLParser.h",
    "UUID.h",
    "UnicodeUtils.h",
    "Userspace.h",
    "Utf16View.h",
    "Utf32View.h",
    "Utf8View.h",
    "Variant.h",
    "Vector.h",
    "WeakPtr.h",
    "Weakable.h",
    "kmalloc.h",
    "kstdio.h",
  ]
}

source_set("sources") {
  deps = [ ":AK" ]

  # FIXME: Split out non-kernel sources to their own set
  sources = [
    "Assertions.cpp",
    "Base64.cpp",
    "CircularBuffer.cpp",
    "ConstrainedStream.cpp",
    "CountingStream.cpp",
    "DOSPackedTime.cpp",
    "DeprecatedFlyString.cpp",
    "DeprecatedString.cpp",
    "Error.cpp",
    "FloatingPointStringConversions.cpp",
    "FlyString.cpp",
    "Format.cpp",
    "FuzzyMatch.cpp",
    "GenericLexer.cpp",
    "Hex.cpp",
    "JsonObject.cpp",
    "JsonParser.cpp",
    "JsonPath.cpp",
    "JsonValue.cpp",
    "LexicalPath.cpp",
    "MemoryStream.cpp",
    "NumberFormat.cpp",
    "OptionParser.cpp",
    "Random.cpp",
    "StackInfo.cpp",
    "Stream.cpp",
    "String.cpp",
    "StringBuilder.cpp",
    "StringFloatingPointConversions.cpp",
    "StringImpl.cpp",
    "StringUtils.cpp",
    "StringView.cpp",
    "Time.cpp",
    "URL.cpp",
    "URLParser.cpp",
    "UUID.cpp",
    "Utf16View.cpp",
    "Utf32View.cpp",
    "Utf8View.cpp",
    "kmalloc.cpp",
  ]
}

write_cmake_config("ak_debug_gen") {
  input = "Debug.h.in"
  output = "$root_gen_dir/AK/Debug.h"
  values = [
    "AFLACLOADER_DEBUG=",
    "AUDIO_DEBUG=",
    "AWAVLOADER_DEBUG=",
    "BINDINGS_GENERATOR_DEBUG=",
    "BMP_DEBUG=",
    "CACHE_DEBUG=",
    "CALLBACK_MACHINE_DEBUG=",
    "CANVAS_RENDERING_CONTEXT_2D_DEBUG=",
    "CMAKE_DEBUG=",
    "COMPOSE_DEBUG=",
    "COPY_DEBUG=",
    "CPP_DEBUG=",
    "CPP_LANGUAGE_SERVER_DEBUG=",
    "CRYPTO_DEBUG=",
    "CSS_LOADER_DEBUG=",
    "CSS_PARSER_DEBUG=",
    "CSS_TOKENIZER_DEBUG=",
    "DDS_DEBUG=",
    "DHCPV4CLIENT_DEBUG=",
    "DHCPV4_DEBUG=",
    "DIFF_DEBUG=",
    "DISASM_DUMP_DEBUG=",
    "DOUBLECLICK_DEBUG=",
    "DRAG_DEBUG=",
    "DWARF_DEBUG=",
    "DYNAMIC_LOAD_DEBUG=",
    "EDITOR_DEBUG=",
    "ELF_IMAGE_DEBUG=",
    "EMOJI_DEBUG=",
    "ESCAPE_SEQUENCE_DEBUG=",
    "EVENT_DEBUG=",
    "FILE_CONTENT_DEBUG=",
    "FILE_WATCHER_DEBUG=",
    "FILL_PATH_DEBUG=",
    "GEMINI_DEBUG=",
    "GENERATE_DEBUG=",
    "GHASH_PROCESS_DEBUG=",
    "GIF_DEBUG=",
    "GLOBAL_DTORS_DEBUG=",
    "GL_DEBUG=",
    "GPT_DEBUG=",
    "HEAP_DEBUG=",
    "HEARTS_DEBUG=",
    "HEX_DEBUG=",
    "HIGHLIGHT_FOCUSED_FRAME_DEBUG=",
    "HTML_PARSER_DEBUG=",
    "HTML_SCRIPT_DEBUG=",
    "HTTPJOB_DEBUG=",
    "HUNKS_DEBUG=",
    "ICO_DEBUG=",
    "IMAGE_DECODER_DEBUG=",
    "IMAGE_LOADER_DEBUG=",
    "ITEM_RECTS_DEBUG=",
    "JOB_DEBUG=",
    "JPEG_DEBUG=",
    "JS_BYTECODE_DEBUG=",
    "JS_MODULE_DEBUG=",
    "KEYBOARD_SHORTCUTS_DEBUG=",
    "LANGUAGE_SERVER_DEBUG=",
    "LEXER_DEBUG=",
    "LIBWEB_CSS_ANIMATION_DEBUG=",
    "LIBWEB_CSS_DEBUG=",
    "LINE_EDITOR_DEBUG=",
    "LOG_DEBUG=",
    "LOOKUPSERVER_DEBUG=",
    "LZMA_DEBUG=",
    "MALLOC_DEBUG=",
    "MARKDOWN_DEBUG=",
    "MATROSKA_DEBUG=",
    "MATROSKA_TRACE_DEBUG=",
    "MBR_DEBUG=",
    "MEMORY_DEBUG=",
    "MENU_DEBUG=",
    "MOVE_DEBUG=",
    "NETWORKJOB_DEBUG=",
    "NT_DEBUG=",
    "OCCLUSIONS_DEBUG=",
    "OPENTYPE_GPOS_DEBUG=",
    "PATH_DEBUG=",
    "PDF_DEBUG=",
    "PLAYBACK_MANAGER_DEBUG=",
    "PNG_DEBUG=",
    "PORTABLE_IMAGE_LOADER_DEBUG=",
    "PROMISE_DEBUG=",
    "PTHREAD_DEBUG=",
    "REACHABLE_DEBUG=",
    "REGEX_DEBUG=",
    "REQUESTSERVER_DEBUG=",
    "RESIZE_DEBUG=",
    "RESOURCE_DEBUG=",
    "RSA_PARSE_DEBUG=",
    "SERVICE_DEBUG=",
    "SHARED_QUEUE_DEBUG=",
    "SHELL_JOB_DEBUG=",
    "SHELL_POSIX_PARSER_DEBUG=",
    "SH_DEBUG=",
    "SH_LANGUAGE_SERVER_DEBUG=",
    "SOLITAIRE_DEBUG=",
    "SPAM_DEBUG=",
    "SPICE_AGENT_DEBUG=",
    "SQLSERVER_DEBUG=",
    "SQL_DEBUG=",
    "SYNTAX_HIGHLIGHTING_DEBUG=",
    "SYSCALL_1_DEBUG=",
    "SYSTEMSERVER_DEBUG=",
    "SYSTEM_MENU_DEBUG=",
    "TERMCAP_DEBUG=",
    "TERMINAL_DEBUG=",
    "TEXTEDITOR_DEBUG=",
    "TIME_ZONE_DEBUG=",
    "TLS_DEBUG=",
    "TLS_SSL_KEYLOG_DEBUG=",
    "TOKENIZER_TRACE_DEBUG=",
    "UCI_DEBUG=",
    "UPDATE_COALESCING_DEBUG=",
    "URL_PARSER_DEBUG=",
    "UTF8_DEBUG=",
    "VPX_DEBUG=",
    "WASI_DEBUG=",
    "WASM_BINPARSER_DEBUG=",
    "WASI_FINE_GRAINED_DEBUG=",
    "WASM_TRACE_DEBUG=",
    "WASM_VALIDATOR_DEBUG=",
    "WEBDRIVER_DEBUG=",
    "WEBGL_CONTEXT_DEBUG=",
    "WEBP_DEBUG=",
    "WEBSERVER_DEBUG=",
    "WEB_FETCH_DEBUG=",
    "WEB_WORKER_DEBUG=",
    "WINDOWMANAGER_DEBUG=",
    "WORKER_THREAD_DEBUG=",
    "WSMESSAGELOOP_DEBUG=",
    "WSSCREEN_DEBUG=",
    "XML_PARSER_DEBUG=",
  ]
}
