Skip to content

Commit

Permalink
[many ports] mingw support (#14556)
Browse files Browse the repository at this point in the history
* [vcpkg_configure_make] Only rename import libs on MSVC

* [x264] Only rename import libs on MSVC

* [x265] Add libc++ and libstdc++ as system libs

* [ffmpeg] mingw support

* [libvpx] Set AS environment variable

* [vcpkg_common_definition] Fix a mistake in the prefix and suffix variables

* [vcpkg_configure_make] Strip leading -l from lib list before joining

* [mp3lame] Use vcpkg_configure_make + mingw support

* [x265] Escape the pluses

* [ffmpeg] Add compiler flags for mingw

* [ffmpeg] Add WINVER define in mf_utils.c

* [ffmpeg] Remove unnecessary patch in 0003-fic-windowsinclude.patch

* [mp3lame] Add missing dollar sign

Co-authored-by: Matthias C. M. Troffaes <matthias.troffaes@gmail.com>

* [x265] Remove static lib when building shared with mingw

* [libogg] Change library name to libogg on mingw

* [libogg] Bump port version

* [x265] Remove -l(std)c++ flag in pkgconfig file

* [vcpkg_configure_make] Try to fix huge diff

* [mp3lame] Add comment on deprecated function lame_init_old

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>

Co-authored-by: Matthias C. M. Troffaes <matthias.troffaes@gmail.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 1, 2020
1 parent 326e8c8 commit 02f6b89
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 102 deletions.
15 changes: 0 additions & 15 deletions ports/ffmpeg/0003-fix-windowsinclude.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,3 @@ index 9cfbc45..e3447e6 100644
#include <windows.h>
#endif

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 01f0410..dbb0736 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -23,6 +23,10 @@
* multimedia converter based on the FFmpeg libraries
*/

+#define _WIN32_WINNT 0x0502 // Must be less than 0x0600, because otherwise WinSock2.h defines "pollfd" which then gets redefined in "os_support.h".
+#define WIN32_LEAN_AND_MEAN
+
+
#include "config.h"
#include <ctype.h>
#include <string.h>
15 changes: 15 additions & 0 deletions ports/ffmpeg/0013-define-WINVER.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --color -Naur src_old/libavcodec/mf_utils.c src/libavcodec/mf_utils.c
--- src_old/libavcodec/mf_utils.c 2020-07-11 05:26:17.000000000 +0700
+++ src/libavcodec/mf_utils.c 2020-11-13 12:55:57.226976400 +0700
@@ -22,6 +22,11 @@
#define _WIN32_WINNT 0x0602
#endif

+#if !defined(WINVER) || WINVER < 0x0602
+#undef WINVER
+#define WINVER 0x0602
+#endif
+
#include "mf_utils.h"
#include "libavutil/pixdesc.h"

76 changes: 46 additions & 30 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vcpkg_from_github(
0010-Fix-x264-detection.patch
0011-Fix-x265-detection.patch
0012-Fix-ssl-110-detection.patch
0013-define-WINVER.patch
)

if (SOURCE_PATH MATCHES " ")
Expand All @@ -25,7 +26,7 @@ endif()
vcpkg_find_acquire_program(YASM)
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)

if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
#We're assuming that if we're building for Windows we're using MSVC
set(INCLUDE_VAR "INCLUDE")
set(LIB_PATH_VAR "LIB")
Expand Down Expand Up @@ -60,7 +61,15 @@ if(VCPKG_TARGET_IS_WINDOWS)
endif()

set(SHELL ${MSYS_ROOT}/usr/bin/bash.exe)
set(OPTIONS "--toolchain=msvc ${OPTIONS}")
if(VCPKG_TARGET_IS_MINGW)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(OPTIONS "--target-os=mingw32 ${OPTIONS}")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(OPTIONS "--target-os=mingw64 ${OPTIONS}")
endif()
else()
set(OPTIONS "--toolchain=msvc ${OPTIONS}")
endif()
else()
set(SHELL /bin/sh)
endif()
Expand Down Expand Up @@ -375,7 +384,9 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
endif()
endif()

if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_MINGW)
set(OPTIONS "${OPTIONS} --extra_cflags=-D_WIN32_WINNT=0x0601")
elseif(VCPKG_TARGET_IS_WINDOWS)
set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0")
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd")
Expand Down Expand Up @@ -442,36 +453,41 @@ endif()

if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/debug/lib/*.def)

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(LIB_MACHINE_ARG /machine:ARM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(LIB_MACHINE_ARG /machine:ARM64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(LIB_MACHINE_ARG /machine:x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(LIB_MACHINE_ARG /machine:x64)
else()
message(FATAL_ERROR "Unsupported target architecture")

if(NOT VCPKG_TARGET_IS_MINGW)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(LIB_MACHINE_ARG /machine:ARM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(LIB_MACHINE_ARG /machine:ARM64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(LIB_MACHINE_ARG /machine:x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(LIB_MACHINE_ARG /machine:x64)
else()
message(FATAL_ERROR "Unsupported target architecture")
endif()

foreach(DEF_FILE ${DEF_FILES})
get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY)
get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME)
string(REGEX REPLACE "-[0-9]*\\.def" "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" OUT_FILE_NAME "${DEF_FILE_NAME}")
file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE)
file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE)
message(STATUS "Generating ${OUT_FILE_NATIVE}")
vcpkg_execute_required_process(
COMMAND lib.exe /def:${DEF_FILE_NATIVE} /out:${OUT_FILE_NATIVE} ${LIB_MACHINE_ARG}
WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}
LOGNAME libconvert-${TARGET_TRIPLET}
)
endforeach()
endif()

foreach(DEF_FILE ${DEF_FILES})
get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY)
get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME)
string(REGEX REPLACE "-[0-9]*\\.def" "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" OUT_FILE_NAME "${DEF_FILE_NAME}")
file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE)
file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE)
message(STATUS "Generating ${OUT_FILE_NATIVE}")
vcpkg_execute_required_process(
COMMAND lib.exe /def:${DEF_FILE_NATIVE} /out:${OUT_FILE_NATIVE} ${LIB_MACHINE_ARG}
WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}
LOGNAME libconvert-${TARGET_TRIPLET}
)
endforeach()


file(GLOB EXP_FILES ${CURRENT_PACKAGES_DIR}/lib/*.exp ${CURRENT_PACKAGES_DIR}/debug/lib/*.exp)
file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX})
list(APPEND FILES_TO_REMOVE ${EXP_FILES} ${LIB_FILES} ${DEF_FILES})
if(VCPKG_TARGET_IS_MINGW)
file(GLOB LIB_FILES_2 ${CURRENT_PACKAGES_DIR}/bin/*.lib ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib)
endif()
list(APPEND FILES_TO_REMOVE ${EXP_FILES} ${LIB_FILES} ${LIB_FILES_2} ${DEF_FILES})
if(FILES_TO_REMOVE)
file(REMOVE ${FILES_TO_REMOVE})
endif()
Expand Down
2 changes: 1 addition & 1 deletion ports/libogg/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: libogg
Version: 1.3.4
Port-Version: 2
Port-Version: 3
Description: Ogg is a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs.
Homepage: https://github.com/xiph/ogg
4 changes: 4 additions & 0 deletions ports/libogg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ vcpkg_from_github(
HEAD_REF master
)

if(VCPKG_TARGET_IS_MINGW)
vcpkg_replace_string(${SOURCE_PATH}/win32/ogg.def "LIBRARY ogg" "LIBRARY libogg")
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand Down
2 changes: 1 addition & 1 deletion ports/libvpx/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: libvpx
Version: 1.9.0
Port-Version: 3
Port-Version: 4
Homepage: https://github.com/webmproject/libvpx
Description: The reference software implementation for the video coding formats VP8 and VP9.
Supports: !(uwp&arm)
Expand Down
2 changes: 1 addition & 1 deletion ports/libvpx/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else()
endif()

include(${CURRENT_INSTALLED_DIR}/share/yasm-tool-helper/yasm-tool-helper.cmake)
yasm_tool_helper(PREPEND_TO_PATH)
yasm_tool_helper(PREPEND_TO_PATH OUT_VAR ENV{AS})

if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)

Expand Down
2 changes: 1 addition & 1 deletion ports/mp3lame/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: mp3lame
Version: 3.100
Port-Version: 4
Port-Version: 5
Homepage: http://lame.sourceforge.net/
Description: LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.
66 changes: 20 additions & 46 deletions ports/mp3lame/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ vcpkg_from_sourceforge(
REF ${VERSION}
FILENAME "lame-${VERSION}.tar.gz"
SHA512 0844b9eadb4aacf8000444621451277de365041cc1d97b7f7a589da0b7a23899310afd4e4d81114b9912aa97832621d20588034715573d417b2923948c08634b
PATCHES 00001-msvc-upgrade-solution-up-to-vc11.patch
PATCHES
00001-msvc-upgrade-solution-up-to-vc11.patch
remove_lame_init_old_from_symbol_list.patch # deprecated https://github.com/zlargon/lame/blob/master/include/lame.h#L169
)

if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(platform "ARM64")
Expand Down Expand Up @@ -84,59 +86,31 @@ else()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(OPTIONS --enable-static=yes --enable-shared=no)
set(MP3LAME_LIB "libmp3lame.a")
set(MP3LAME_LIB "libmp3lame.${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}")
else()
set(OPTIONS --enable-shared=yes --enable-static=no)
set(MP3LAME_LIB "libmp3lame.so")
if(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX)
set(MP3LAME_LIB "libmp3lame.${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}")
else()
set(MP3LAME_LIB "libmp3lame.${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
endif()
endif()

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
if(NOT VCPKG_TARGET_IS_MINGW)
string(APPEND OPTIONS --with-pic=yes)
endif()

message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND ${SOURCE_PATH}/configure ${OPTIONS} --with-pic=yes --prefix=${CURRENT_PACKAGES_DIR}/debug
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
LOGNAME configure-${TARGET_TRIPLET}-dbg
)
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND make -j install "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}"
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
LOGNAME install-${TARGET_TRIPLET}-dbg
)
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
DETERMINE_BUILD_TRIPLET
OPTIONS ${OPTIONS}
)

file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/bin
vcpkg_install_make()
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
)
endif()

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)

message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${SOURCE_PATH}/configure ${OPTIONS} --with-pic=yes --prefix=${CURRENT_PACKAGES_DIR}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
LOGNAME configure-${TARGET_TRIPLET}-rel
)

message(STATUS "Building ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND make -j install "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}"
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
LOGNAME install-${TARGET_TRIPLET}-rel
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
endif()

endif()

endif()

Expand Down
9 changes: 9 additions & 0 deletions ports/mp3lame/remove_lame_init_old_from_symbol_list.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --color -Naur src_old/include/libmp3lame.sym src/include/libmp3lame.sym
--- src_old/include/libmp3lame.sym 2017-09-07 02:33:35.000000000 +0700
+++ src/include/libmp3lame.sym 2020-11-12 17:45:59.946448300 +0700
@@ -1,5 +1,4 @@
lame_init
-lame_init_old
lame_set_num_samples
lame_get_num_samples
lame_set_in_samplerate
2 changes: 1 addition & 1 deletion ports/x264/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: x264
Version: 157-303c484ec828ed0
Port-Version: 13
Port-Version: 14
Homepage: https://github.com/mirror/x264
Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format
Build-Depends: pthread (linux&osx)
2 changes: 1 addition & 1 deletion ports/x264/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if(VCPKG_TARGET_IS_WINDOWS)
endif()
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/libx264.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.lib)
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
Expand Down
1 change: 1 addition & 0 deletions ports/x265/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: x265
Version: 3.4
Port-Version: 1
Homepage: https://github.com/videolan/x265
Description: x265 is a H.265 / HEVC video encoder application library, designed to encode video or images into an H.265 / HEVC encoded bitstream.
17 changes: 16 additions & 1 deletion ports/x265/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,28 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
endif()

if(WIN32 AND (NOT MINGW))
if(VCPKG_TARGET_IS_WINDOWS AND (NOT VCPKG_TARGET_IS_MINGW))
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x265.pc" "-lx265" "-lx265-static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x265.pc" "-lx265" "-lx265-static")
endif()
endif()

# maybe create vcpkg_regex_replace_string?

file(READ ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x265.pc _contents)
string(REGEX REPLACE "-l(std)?c\\+\\+" "" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x265.pc "${_contents}")

file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x265.pc _contents)
string(REGEX REPLACE "-l(std)?c\\+\\+" "" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x265.pc "${_contents}")

if(VCPKG_TARGET_IS_MINGW AND ENABLE_SHARED)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libx265.a)
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libx265.a)
endif()

if(UNIX)
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES numa)
else()
Expand Down
4 changes: 2 additions & 2 deletions scripts/cmake/vcpkg_common_definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ endif()
#This allows us scale down on hardcoded target dependent paths in portfiles
set(CMAKE_STATIC_LIBRARY_SUFFIX "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}")
set(CMAKE_SHARED_LIBRARY_SUFFIX "${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
set(CMAKE_IMPORT_LIBRARY_SUFFIX "${VCPKG_TARGET_IMPORT_LIBRARY_PREFIX}")
set(CMAKE_IMPORT_LIBRARY_SUFFIX "${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}")
set(CMAKE_STATIC_LIBRARY_PREFIX "${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}")
set(CMAKE_SHARED_LIBRARY_PREFIX "${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}")
set(CMAKE_IMPORT_LIBRARY_PREFIX "${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}")
set(CMAKE_IMPORT_LIBRARY_PREFIX "${VCPKG_TARGET_IMPORT_LIBRARY_PREFIX}")

set(CMAKE_FIND_LIBRARY_SUFFIXES "${VCPKG_FIND_LIBRARY_SUFFIXES}" CACHE INTERNAL "") # Required by find_library
set(CMAKE_FIND_LIBRARY_PREFIXES "${VCPKG_FIND_LIBRARY_PREFIXES}" CACHE INTERNAL "") # Required by find_library
Expand Down
4 changes: 2 additions & 2 deletions scripts/cmake/vcpkg_configure_make.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ function(vcpkg_configure_make)
set(ALL_LIBS_LIST ${C_LIBS_LIST} ${CXX_LIBS_LIST})
list(REMOVE_DUPLICATES ALL_LIBS_LIST)
list(TRANSFORM ALL_LIBS_LIST STRIP)

#Do lib list transformation from name.lib to -lname if necessary
set(_VCPKG_TRANSFORM_LIBS TRUE)
if(VCPKG_TARGET_IS_UWP)
Expand All @@ -501,6 +500,7 @@ function(vcpkg_configure_make)
if(VCPKG_TARGET_IS_WINDOWS)
list(REMOVE_ITEM ALL_LIBS_LIST "uuid")
endif()
list(TRANSFORM ALL_LIBS_LIST REPLACE "^(${_lprefix})" "")
endif()
list(JOIN ALL_LIBS_LIST " ${_lprefix}" ALL_LIBS_STRING)

Expand Down Expand Up @@ -681,7 +681,7 @@ function(vcpkg_configure_make)
WORKING_DIRECTORY "${TAR_DIR}"
LOGNAME config-${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}
)
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(GLOB_RECURSE LIBTOOL_FILES "${TAR_DIR}*/libtool")
foreach(lt_file IN LISTS LIBTOOL_FILES)
file(READ "${lt_file}" _contents)
Expand Down

0 comments on commit 02f6b89

Please sign in to comment.