Skip to content

Commit 0eaac44

Browse files
committed
Merge pull request #10070
53375a7 CMake: fix msys/ICU compilation failure (0xFFFC0000)
2 parents 81f948a + 53375a7 commit 0eaac44

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,19 @@ if(MINGW)
11151115
if(DEPENDS)
11161116
set(ICU_LIBRARIES icuio icui18n icuuc icudata icutu iconv)
11171117
else()
1118-
set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
1118+
# This is an extremely ugly hack to get around Boost not being built with static ICU.
1119+
# We reported the issue, we are waiting for upstream to fix this issue: https://github.com/boostorg/boost/issues/1079#issue-3384962885
1120+
# This hack links shared ICU libs to avoid linker errors we get in MSYS2 compilation (undefined symbols to ICU).
1121+
set(OLD_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
1122+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a")
1123+
find_library(ICUIO_LIBRARIES NAMES icuio REQUIRED)
1124+
find_library(ICUIN_LIBRARIES NAMES icuin REQUIRED)
1125+
find_library(ICUUC_LIBRARIES NAMES icuuc REQUIRED)
1126+
find_library(ICUDT_LIBRARIES NAMES icudt REQUIRED)
1127+
find_library(ICUTU_LIBRARIES NAMES icutu REQUIRED)
1128+
find_library(ICONV_LIBRARIES NAMES iconv REQUIRED)
1129+
set(ICU_LIBRARIES ${ICUIO_LIBRARIES} ${ICUIN_LIBRARIES} ${ICUUC_LIBRARIES} ${ICUDT_LIBRARIES} ${ICUTU_LIBRARIES} ${ICONV_LIBRARIES})
1130+
set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_LIB_SUFFIXES})
11191131
endif()
11201132
elseif(APPLE OR OPENBSD OR ANDROID)
11211133
set(EXTRA_LIBRARIES "")

0 commit comments

Comments
 (0)