Forráskód Böngészése

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. :^)
Andreas Kling 4 éve
szülő
commit
0dbf786aed
2 módosított fájl, 6 hozzáadás és 2 törlés
  1. 6 1
      AK/JsonValue.cpp
  2. 0 1
      Kernel/CMakeLists.txt

+ 6 - 1
AK/JsonValue.cpp

@@ -6,9 +6,12 @@
 
 #include <AK/JsonArray.h>
 #include <AK/JsonObject.h>
-#include <AK/JsonParser.h>
 #include <AK/JsonValue.h>
 
+#ifndef KERNEL
+#    include <AK/JsonParser.h>
+#endif
+
 namespace AK {
 
 JsonValue::JsonValue(Type type)
@@ -224,9 +227,11 @@ void JsonValue::clear()
     m_value.as_string = nullptr;
 }
 
+#ifndef KERNEL
 Optional<JsonValue> JsonValue::from_string(const StringView& input)
 {
     return JsonParser(input).parse();
 }
+#endif
 
 }

+ 0 - 1
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