Skip to content

Commit 0abdcc4

Browse files
authored
Merge pull request #3133 from Azoy/fix-icu-static-linking
[cmake] Fix ICU static linking
2 parents ac78023 + 602c081 commit 0abdcc4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/Foundation/CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,19 @@ if(NOT BUILD_SHARED_LIBS)
176176
get_filename_component(icu_i18n_dir "${icui18n_path}" DIRECTORY)
177177
string(REPLACE "lib" "" icu_i18n_basename "${icu_i18n_basename}")
178178

179+
get_target_property(icuuc_path ICU::uc IMPORTED_LOCATION)
180+
get_filename_component(icu_uc_basename "${icuuc_path}" NAME_WE)
181+
string(REPLACE "lib" "" icu_uc_basename "${icu_uc_basename}")
182+
183+
get_target_property(icudata_path ICU::data IMPORTED_LOCATION)
184+
get_filename_component(icu_data_basename "${icudata_path}" NAME_WE)
185+
string(REPLACE "lib" "" icu_data_basename "${icu_data_basename}")
186+
179187
target_compile_options(Foundation
180188
PRIVATE
181189
"SHELL:-Xfrontend -public-autolink-library -Xfrontend ${icu_i18n_basename}
190+
-Xfrontend -public-autolink-library -Xfrontend ${icu_uc_basename}
191+
-Xfrontend -public-autolink-library -Xfrontend ${icu_data_basename}
182192
-Xfrontend -public-autolink-library -Xfrontend BlocksRuntime")
183193
# ICU libraries are linked by absolute library path in this project,
184194
# but -public-autolink-library forces to resolve library path by

0 commit comments

Comments
 (0)