ladybird/AK/CMakeLists.txt
Timothy Flynn bfc9dc447f AK+LibWeb: Replace our home-grown base64 encoder/decoders with simdutf
We currently have 2 base64 coders: one in AK, another in LibWeb for a
"forgiving" implementation. ECMA-262 has an upcoming proposal which will
require a third implementation.

Instead, let's use the base64 implementation that is used by Node.js and
recommended by the upcoming proposal. It handles forgiving decoding as
well.

Our users of AK's implementation should be fine with the forgiving
implementation. The AK impl originally had naive forgiving behavior, but
that was removed solely for performance reasons.

Using http://mattmahoney.net/dc/enwik8.zip (100MB unzipped) as a test,
performance of our old home-grown implementations vs. the simdutf
implementation (on Linux x64):

                Encode    Decode
AK base64       0.226s    0.169s
LibWeb base64   N/A       1.244s
simdutf         0.161s    0.047s
2024-07-16 10:27:39 +02:00

66 lines
1.4 KiB
CMake

set(SOURCES
Assertions.cpp
CircularBuffer.cpp
ConstrainedStream.cpp
CountingStream.cpp
DOSPackedTime.cpp
DeprecatedFlyString.cpp
ByteString.cpp
Error.cpp
FloatingPointStringConversions.cpp
FlyString.cpp
Format.cpp
GenericLexer.cpp
Hex.cpp
JsonObject.cpp
JsonParser.cpp
JsonValue.cpp
LexicalPath.cpp
MemoryStream.cpp
NumberFormat.cpp
OptionParser.cpp
Random.cpp
SipHash.cpp
StackInfo.cpp
Stream.cpp
String.cpp
StringBase.cpp
StringBuilder.cpp
StringFloatingPointConversions.cpp
StringImpl.cpp
StringUtils.cpp
StringView.cpp
Time.cpp
Utf16View.cpp
Utf32View.cpp
Utf8View.cpp
kmalloc.cpp
)
if (NOT LAGOM_TOOLS_ONLY)
list(APPEND SOURCES Base64.cpp)
endif()
serenity_lib(AK ak)
serenity_install_headers(AK)
serenity_install_sources(AK)
find_package(Backtrace)
configure_file(Backtrace.h.in Backtrace.h @ONLY)
if (Backtrace_FOUND)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.30)
target_link_libraries(AK PRIVATE Backtrace::Backtrace)
else()
target_include_directories(AK PRIVATE ${Backtrace_INCLUDE_DIRS})
target_link_libraries(AK PRIVATE ${Backtrace_LIBRARIES})
endif()
else()
message(WARNING "Backtrace not found, stack traces will be unavailable")
endif()
if (NOT LAGOM_TOOLS_ONLY)
find_package(simdutf REQUIRED)
target_link_libraries(AK PRIVATE simdutf::simdutf)
endif()