Skip to content

Commit d885347

Browse files
committed
Merge pull request #10069
0b1b9f7 CMake: fix msys/ICU compilation failure (0xFFFC0000)
2 parents 8259df0 + 0b1b9f7 commit d885347

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
@@ -1067,7 +1067,19 @@ if(MINGW)
10671067
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
10681068
set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt)
10691069
if(NOT DEPENDS)
1070-
set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
1070+
# This is an extremely ugly hack to get around Boost not being built with static ICU.
1071+
# We reported the issue, we are waiting for upstream to fix this issue: https://github.com/boostorg/boost/issues/1079#issue-3384962885
1072+
# This hack links shared ICU libs to avoid linker errors we get in MSYS2 compilation (undefined symbols to ICU).
1073+
set(OLD_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
1074+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a")
1075+
find_library(ICUIO_LIBRARIES NAMES icuio REQUIRED)
1076+
find_library(ICUIN_LIBRARIES NAMES icuin REQUIRED)
1077+
find_library(ICUUC_LIBRARIES NAMES icuuc REQUIRED)
1078+
find_library(ICUDT_LIBRARIES NAMES icudt REQUIRED)
1079+
find_library(ICUTU_LIBRARIES NAMES icutu REQUIRED)
1080+
find_library(ICONV_LIBRARIES NAMES iconv REQUIRED)
1081+
set(ICU_LIBRARIES ${ICUIO_LIBRARIES} ${ICUIN_LIBRARIES} ${ICUUC_LIBRARIES} ${ICUDT_LIBRARIES} ${ICUTU_LIBRARIES} ${ICONV_LIBRARIES})
1082+
set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_LIB_SUFFIXES})
10711083
endif()
10721084
elseif(APPLE OR OPENBSD OR ANDROID)
10731085
set(EXTRA_LIBRARIES "")

0 commit comments

Comments
 (0)