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.
This commit is contained in:
Timothy Flynn 2024-06-14 07:24:17 -04:00 committed by Andreas Kling
parent 57c735dec4
commit fdacf8ebeb
Notes: sideshowbarker 2024-07-17 17:38:29 +09:00

View File

@ -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.*")