From 56a33d86b3abf9792f24df3b550ce7d32ce420e7 Mon Sep 17 00:00:00 2001 From: huangqinjin Date: Tue, 27 Jul 2021 01:53:47 +0800 Subject: [PATCH] [vcpkg/scripts/make] avoid versioning for android (#17089) --- scripts/cmake/vcpkg_configure_make.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 599eaf5917..65d66daac9 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -772,6 +772,14 @@ function(vcpkg_configure_make) set(ENV{CXXFLAGS} "${CXXFLAGS_${_buildtype}}") set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${_buildtype}}") set(ENV{LDFLAGS} "${LDFLAGS_${_buildtype}}") + + # https://www.gnu.org/software/libtool/manual/html_node/Link-mode.html + # -avoid-version is handled specially by libtool link mode, this flag is not forwarded to linker, + # and libtool tries to avoid versioning for shared libraries and no symbolic links are created. + if(VCPKG_TARGET_IS_ANDROID) + set(ENV{LDFLAGS} "-avoid-version $ENV{LDFLAGS}") + endif() + if(LINK_ENV_${_VAR_SUFFIX}) set(_LINK_CONFIG_BACKUP "$ENV{_LINK_}") set(ENV{_LINK_} "${LINK_ENV_${_VAR_SUFFIX}}")