feat: fix rpath setting in osx dynamic debug build (#31681)

This commit is contained in:
SIYAO CHEN 2023-06-01 09:56:41 +08:00 committed by GitHub
parent 0f1f5200c6
commit 65e91ebd9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 42 deletions

View File

@ -88,53 +88,58 @@ if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
if("tools" IN_LIST FEATURES)
set(LIBICUTU_RPATH "libicutu")
endif()
# add ID_PREFIX to libicudata libicui18n libicuio libicutu libicuuc
foreach(LIB_NAME IN ITEMS libicudata libicui18n libicuio ${LIBICUTU_RPATH} libicuuc)
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -id "${ID_PREFIX}/${LIB_NAME}.${ICU_VERSION_MAJOR}.dylib"
"${LIB_NAME}.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib"
LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}"
)
endforeach()
# add ID_PREFIX to libicui18n libicuio libicutu dependencies
foreach(LIB_NAME IN ITEMS libicui18n libicuio)
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -change "libicuuc.${ICU_VERSION_MAJOR}.dylib"
"${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib"
"${LIB_NAME}.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib"
LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}"
)
#31680: Fix @rpath in both debug and release build
foreach(CONFIG_TRIPLE IN ITEMS ${DEBUG_TRIPLET} ${RELEASE_TRIPLET})
# add ID_PREFIX to libicudata libicui18n libicuio libicutu libicuuc
foreach(LIB_NAME IN ITEMS libicudata libicui18n libicuio ${LIBICUTU_RPATH} libicuuc)
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -id "${ID_PREFIX}/${LIB_NAME}.${ICU_VERSION_MAJOR}.dylib"
"${LIB_NAME}.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib"
LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}"
)
endforeach()
# add ID_PREFIX to libicui18n libicuio libicutu dependencies
foreach(LIB_NAME IN ITEMS libicui18n libicuio)
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -change "libicuuc.${ICU_VERSION_MAJOR}.dylib"
"${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib"
"${LIB_NAME}.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib"
LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}"
)
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -change "libicudata.${ICU_VERSION_MAJOR}.dylib"
"${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib"
"${LIB_NAME}.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib"
LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}"
)
endforeach()
# add ID_PREFIX to remaining libicuio libicutu dependencies
foreach(LIB_NAME libicuio libicutu)
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -change "libicui18n.${ICU_VERSION_MAJOR}.dylib"
"${ID_PREFIX}/libicui18n.${ICU_VERSION_MAJOR}.dylib"
"${LIB_NAME}.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib"
LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}"
)
endforeach()
# add ID_PREFIX to libicuuc dependencies
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -change "libicudata.${ICU_VERSION_MAJOR}.dylib"
"${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib"
"${LIB_NAME}.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib"
LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}"
"libicuuc.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib"
LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}"
)
endforeach()
# add ID_PREFIX to remaining libicuio libicutu dependencies
foreach(LIB_NAME libicuio libicutu)
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -change "libicui18n.${ICU_VERSION_MAJOR}.dylib"
"${ID_PREFIX}/libicui18n.${ICU_VERSION_MAJOR}.dylib"
"${LIB_NAME}.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib"
LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}"
)
endforeach()
# add ID_PREFIX to libicuuc dependencies
vcpkg_execute_build_process(
COMMAND "${INSTALL_NAME_TOOL}" -change "libicudata.${ICU_VERSION_MAJOR}.dylib"
"${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib"
"libicuuc.${VERSION}.dylib"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib"
LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}"
)
endif()
vcpkg_install_make()

View File

@ -1,7 +1,7 @@
{
"name": "icu",
"version": "72.1",
"port-version": 4,
"port-version": 5,
"description": "Mature and widely used Unicode and localization library.",
"homepage": "https://icu.unicode.org/home",
"license": "ICU",

View File

@ -3190,7 +3190,7 @@
},
"icu": {
"baseline": "72.1",
"port-version": 4
"port-version": 5
},
"ideviceinstaller": {
"baseline": "1.1.2.23",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c1735b83e7793135a9d1e3689f7d36475f6d5ff7",
"version": "72.1",
"port-version": 5
},
{
"git-tree": "1a0b575f86d37844108f940fd5f6a312a68d234c",
"version": "72.1",