1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Do not require ICU on MinGW and MSVC targets.

This commit is contained in:
Aaron van Geffen
2018-05-15 16:37:41 +02:00
parent 4c67c0eaca
commit bf1fd997d0
2 changed files with 17 additions and 10 deletions

View File

@@ -58,9 +58,6 @@ if (NOT DISABLE_TTF)
endif ()
endif ()
# For unicode code page conversion.
find_package(ICU 59.0 REQUIRED COMPONENTS uc)
# Sources
file(GLOB_RECURSE OPENRCT2_CORE_SOURCES "${CMAKE_CURRENT_LIST_DIR}/*.cpp"
"${CMAKE_CURRENT_LIST_DIR}/*.h"
@@ -81,14 +78,12 @@ if (STATIC)
target_link_libraries(${PROJECT} ${JANSSON_STATIC_LIBRARIES}
${PNG_STATIC_LIBRARIES}
${ZLIB_STATIC_LIBRARIES}
${LIBZIP_STATIC_LIBRARIES}
${ICU_STATIC_LIBRARIES})
${LIBZIP_STATIC_LIBRARIES})
else ()
target_link_libraries(${PROJECT} ${JANSSON_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
${LIBZIP_LIBRARIES}
${ICU_LIBRARIES})
${LIBZIP_LIBRARIES})
endif ()
if (UNIX AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
@@ -115,6 +110,16 @@ if (NOT DISABLE_NETWORK)
endif ()
endif ()
if (NOT MINGW AND NOT MSVC)
# For unicode code page conversion.
find_package(ICU 59.0 REQUIRED COMPONENTS uc)
if (STATIC)
target_link_libraries(${PROJECT} ${ICU_STATIC_LIBRARIES})
else ()
target_link_libraries(${PROJECT} ${ICU_LIBRARIES})
endif ()
endif ()
if (NOT APPLE AND NOT MINGW AND NOT MSVC)
# This is ugly hack to work around https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1568899.
# Once C++17 is enabled (and thus old compilers are no longer supported, this needs to be gone.

View File

@@ -91,9 +91,11 @@ add_library(test-common STATIC ${COMMON_TEST_SOURCES})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_LIST_DIR}/testdata" "${CMAKE_CURRENT_BINARY_DIR}/testdata")
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/openrct2\" \"${CMAKE_CURRENT_BINARY_DIR}/data\")")
# For unicode code page conversion (required for ini and string tests)
find_package(ICU 59.0 REQUIRED COMPONENTS uc)
target_link_libraries(test-common ${ICU_LIBRARIES})
if (NOT MINGW AND NOT MSVC)
# For unicode code page conversion (required for ini and string tests)
find_package(ICU 59.0 REQUIRED COMPONENTS uc)
target_link_libraries(test-common ${ICU_LIBRARIES})
endif ()
# Start of our tests