From 0dbf786aed185dcb1fa24727f1e33b1c2fc14ab3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 29 Jun 2021 22:19:29 +0200 Subject: [PATCH] Kernel+AK: Don't compile JSON parser into the kernel The kernel doesn't consume JSON, it only produces it. So there's no need for the kernel to have a JSON parser built into it. :^) --- AK/JsonValue.cpp | 7 ++++++- Kernel/CMakeLists.txt | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AK/JsonValue.cpp b/AK/JsonValue.cpp index c3682046a8..439b8f1859 100644 --- a/AK/JsonValue.cpp +++ b/AK/JsonValue.cpp @@ -6,9 +6,12 @@ #include #include -#include #include +#ifndef KERNEL +# include +#endif + namespace AK { JsonValue::JsonValue(Type type) @@ -224,9 +227,11 @@ void JsonValue::clear() m_value.as_string = nullptr; } +#ifndef KERNEL Optional JsonValue::from_string(const StringView& input) { return JsonParser(input).parse(); } +#endif } diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index c3d5360e6b..bf937387c6 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -301,7 +301,6 @@ set(AK_SOURCES ../AK/FlyString.cpp ../AK/GenericLexer.cpp ../AK/Hex.cpp - ../AK/JsonParser.cpp ../AK/JsonValue.cpp ../AK/LexicalPath.cpp ../AK/String.cpp