Browse Source

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.
Timothy Flynn 1 year ago
parent
commit
fdacf8ebeb
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Userland/Libraries/LibJS/CMakeLists.txt

+ 4 - 1
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.*")