From 5fb4257c3c7ff24b676dc379adbab0e9a668e42d Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 12 Oct 2021 20:27:43 +0200 Subject: [PATCH] [boost-modular-build-helper] Fixup mingw lib names (#20576) * Fixup mingw lib names on windows * Update versions * Bump boost-modular-build-helper port-version. Co-authored-by: Billy Robert O'Neal III --- .../boost-modular-build.cmake | 14 ++++++++++++++ ports/boost-modular-build-helper/vcpkg.json | 2 +- scripts/boost/generate-ports.ps1 | 2 +- versions/b-/boost-modular-build-helper.json | 5 +++++ versions/baseline.json | 2 +- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ports/boost-modular-build-helper/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake index 4e7dfb4563..8d082b26b7 100644 --- a/ports/boost-modular-build-helper/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -130,6 +130,20 @@ function(boost_modular_build) file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) endif() endforeach() + # Similar for mingw + file(GLOB INSTALLED_LIBS "${CURRENT_PACKAGES_DIR}/debug/lib/*-mgw10-*.a" "${CURRENT_PACKAGES_DIR}/lib/*-mgw10-*.a") + foreach(LIB IN LISTS INSTALLED_LIBS) + get_filename_component(OLD_FILENAME "${LIB}" NAME) + get_filename_component(DIRECTORY_OF_LIB_FILE "${LIB}" DIRECTORY) + string(REGEX REPLACE "-mgw[0-9]+-.*[0-9](\\.dll\\.a|\\.a)$" "\\1" NEW_FILENAME "${OLD_FILENAME}") + if("${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}" STREQUAL "${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}") + # nothing to do + elseif(EXISTS "${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}") + file(REMOVE "${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}") + else() + file(RENAME "${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}" "${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}") + endif() + endforeach() # boost-regex[icu] and boost-locale[icu] generate has_icu.lib if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/has_icu.lib") diff --git a/ports/boost-modular-build-helper/vcpkg.json b/ports/boost-modular-build-helper/vcpkg.json index e81e9a0fce..71d528590f 100644 --- a/ports/boost-modular-build-helper/vcpkg.json +++ b/ports/boost-modular-build-helper/vcpkg.json @@ -1,7 +1,7 @@ { "name": "boost-modular-build-helper", "version": "1.77.0", - "port-version": 1, + "port-version": 2, "description": "Internal vcpkg port used to build Boost libraries", "dependencies": [ "boost-uninstall" diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index 7a32a0a8c3..a626daf34f 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -28,7 +28,7 @@ $portVersions = @{ "boost-config" = 2; "boost-gil" = 1; "boost-iostreams" = 1; - "boost-modular-build-helper" = 1; + "boost-modular-build-helper" = 2; "boost-odeint" = 1; "boost-python" = 1; "boost-process" = 2; diff --git a/versions/b-/boost-modular-build-helper.json b/versions/b-/boost-modular-build-helper.json index 867e62be31..7985f1f490 100644 --- a/versions/b-/boost-modular-build-helper.json +++ b/versions/b-/boost-modular-build-helper.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "9795fd3f465461fea28201a773909b6fd0e3400b", + "version": "1.77.0", + "port-version": 2 + }, { "git-tree": "c076291c3d44f7cea167e469748ead6270e1c424", "version": "1.77.0", diff --git a/versions/baseline.json b/versions/baseline.json index 25a33f2024..16ea1895cd 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -810,7 +810,7 @@ }, "boost-modular-build-helper": { "baseline": "1.77.0", - "port-version": 1 + "port-version": 2 }, "boost-move": { "baseline": "1.77.0",