-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix issue #3683 - fix ICU build on Linux #3685
Merged
+96
−58
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,60 @@ set(ICU_VERSION_MAJOR 61) | |
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/icu-${VERSION}/icu) | ||
vcpkg_download_distfile( | ||
ARCHIVE | ||
URLS "http://download.icu-project.org/files/icu4c/${VERSION}/icu4c-${VERSION2}-src.zip" | ||
FILENAME "icu4c-${VERSION2}-src.zip" | ||
SHA512 60fed25976b8c2fe2df0b0ab745ded24da237711ec8c1e1dbdfe6eaf2014fb6b3a4bcaa488174cf770737a1c159a2d3f48a86a139cbb277163f064e607b8928f | ||
URLS "http://download.icu-project.org/files/icu4c/${VERSION}/icu4c-${VERSION2}-src.tgz" | ||
FILENAME "icu4c-${VERSION2}-src.tgz" | ||
SHA512 4c37691246db802e4bae0c8c5f6ac1dac64c5753b607e539c5c1c36e361fcd9dd81bd1d3b5416c2960153b83700ccdb356412847d0506ab7782ae626ac0ffb94 | ||
) | ||
vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src/icu-${VERSION}) | ||
|
||
vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} | ||
PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable-escapestr-tool.patch) | ||
|
||
set(CONFIGURE_OPTIONS "--disable-samples --disable-tests") | ||
|
||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) | ||
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --disable-static --enable-shared") | ||
else() | ||
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --enable-static --disable-shared") | ||
endif() | ||
|
||
set(CONFIGURE_OPTIONS_RELASE "--disable-debug --enable-release --prefix=${CURRENT_PACKAGES_DIR}") | ||
set(CONFIGURE_OPTIONS_DEBUG "--enable-debug --disable-release --prefix=${CURRENT_PACKAGES_DIR}/debug") | ||
|
||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
|
||
set(BASH bash) | ||
|
||
# Configure release | ||
message(STATUS "Configuring ${TARGET_TRIPLET}-rel") | ||
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) | ||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) | ||
set(ENV{CFLAGS} "-O2") | ||
set(ENV{CXXFLAGS} "-O2") | ||
vcpkg_execute_required_process( | ||
COMMAND ${BASH} --noprofile --norc -c | ||
"${SOURCE_PATH}/source/runConfigureICU Linux ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_RELASE}" | ||
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" | ||
LOGNAME "configure-${TARGET_TRIPLET}-rel") | ||
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") | ||
|
||
# Configure debug | ||
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") | ||
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) | ||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) | ||
set(ENV{CFLAGS} "-O0 -g") | ||
set(ENV{CXXFLAGS} "-O0 -g") | ||
vcpkg_execute_required_process( | ||
COMMAND ${BASH} --noprofile --norc -c | ||
"${SOURCE_PATH}/source/runConfigureICU Linux ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_DEBUG}" | ||
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" | ||
LOGNAME "configure-${TARGET_TRIPLET}-dbg") | ||
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") | ||
|
||
else() # not Linux: | ||
|
||
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --host=i686-pc-mingw32") | ||
|
||
# Acquire tools | ||
vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15) | ||
|
||
|
@@ -42,17 +87,6 @@ set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) | |
set(AUTOMAKE_DIR ${MSYS_ROOT}/usr/share/automake-1.15) | ||
file(COPY ${AUTOMAKE_DIR}/config.guess ${AUTOMAKE_DIR}/config.sub DESTINATION ${SOURCE_PATH}/source) | ||
|
||
set(CONFIGURE_OPTIONS "--host=i686-pc-mingw32 --disable-samples --disable-tests") | ||
|
||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) | ||
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --disable-static --enable-shared") | ||
else() | ||
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --enable-static --disable-shared") | ||
endif() | ||
|
||
set(CONFIGURE_OPTIONS_RELASE "--disable-debug --enable-release --prefix=${CURRENT_PACKAGES_DIR}") | ||
set(CONFIGURE_OPTIONS_DEBUG "--enable-debug --disable-release --prefix=${CURRENT_PACKAGES_DIR}/debug") | ||
|
||
if(VCPKG_CRT_LINKAGE STREQUAL static) | ||
set(ICU_RUNTIME "-MT") | ||
else() | ||
|
@@ -87,6 +121,8 @@ vcpkg_execute_required_process( | |
LOGNAME "configure-${TARGET_TRIPLET}-dbg") | ||
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") | ||
|
||
endif() | ||
|
||
unset(ENV{CFLAGS}) | ||
unset(ENV{CXXFLAGS}) | ||
unset(ENV{LDFLAGS}) | ||
|
@@ -130,12 +166,15 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) | |
file(COPY ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) | ||
file(COPY ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) | ||
else() | ||
# rename static libraries to match import libs | ||
# see https://gitlab.kitware.com/cmake/cmake/issues/16617 | ||
foreach(MODULE dt in io tu uc) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/sicu${MODULE}.lib ${CURRENT_PACKAGES_DIR}/lib/icu${MODULE}.lib) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sicu${MODULE}d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/icu${MODULE}d.lib) | ||
endforeach() | ||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") |
||
else() | ||
# rename static libraries to match import libs | ||
# see https://gitlab.kitware.com/cmake/cmake/issues/16617 | ||
foreach(MODULE dt in io tu uc) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/sicu${MODULE}.lib ${CURRENT_PACKAGES_DIR}/lib/icu${MODULE}.lib) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sicu${MODULE}d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/icu${MODULE}d.lib) | ||
endforeach() | ||
endif() | ||
|
||
# force U_STATIC_IMPLEMENTATION macro | ||
foreach(HEADER utypes.h utf_old.h platform.h) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an indent for the code inside
if
?