From fdacf8ebeb35352a564d99f2c834b3436d3c22f0 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 14 Jun 2024 07:24:17 -0400 Subject: [PATCH] LibJS: Link LibLocale publicly to ensure ICU data is available Linking LibLocale publicly ensures that libicudata.a is also available in all embedders of LibJS. Otherwise, ICU crashes in hard-to-track-down ways at runtime when the data is not available. --- Userland/Libraries/LibJS/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/CMakeLists.txt b/Userland/Libraries/LibJS/CMakeLists.txt index 7fc849c9af1..9080c8a6e08 100644 --- a/Userland/Libraries/LibJS/CMakeLists.txt +++ b/Userland/Libraries/LibJS/CMakeLists.txt @@ -271,7 +271,10 @@ set(SOURCES ) serenity_lib(LibJS js) -target_link_libraries(LibJS PRIVATE LibCore LibCrypto LibFileSystem LibRegex LibSyntax LibLocale LibUnicode LibTimeZone) +target_link_libraries(LibJS PRIVATE LibCore LibCrypto LibFileSystem LibRegex LibSyntax LibUnicode LibTimeZone) + +# Link LibLocale publicly to ensure ICU data (which is in libicudata.a) is available in any process using LibJS. +target_link_libraries(LibJS PUBLIC LibLocale) # TODO: This is probably also needed on RISC-V. if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i.86.*")