diff --git a/ports/ffmpeg/0003-fix-windowsinclude.patch b/ports/ffmpeg/0003-fix-windowsinclude.patch index 8fe6a5474ee247..8ac04c8656bf0c 100644 --- a/ports/ffmpeg/0003-fix-windowsinclude.patch +++ b/ports/ffmpeg/0003-fix-windowsinclude.patch @@ -11,18 +11,3 @@ index 9cfbc45..e3447e6 100644 #include #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 - #include diff --git a/ports/ffmpeg/0013-define-WINVER.patch b/ports/ffmpeg/0013-define-WINVER.patch new file mode 100644 index 00000000000000..295a738e74f7e7 --- /dev/null +++ b/ports/ffmpeg/0013-define-WINVER.patch @@ -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" + diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 4ea0d0400b1bc9..0667d882267826 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,6 +1,6 @@ Source: ffmpeg Version: 4.3.1 -Port-Version: 7 +Port-Version: 8 Homepage: https://ffmpeg.org Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations. diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index cbe8df318c16b3..9ba7de91bb9571 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -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 " ") @@ -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") @@ -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() @@ -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") @@ -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() diff --git a/ports/libogg/CONTROL b/ports/libogg/CONTROL index c89497a19fa74f..57d1748eee8fa7 100644 --- a/ports/libogg/CONTROL +++ b/ports/libogg/CONTROL @@ -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 diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake index e493687c3e9781..2316a2a8a180c3 100644 --- a/ports/libogg/portfile.cmake +++ b/ports/libogg/portfile.cmake @@ -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 diff --git a/ports/libvpx/CONTROL b/ports/libvpx/CONTROL index 963047270f6ea3..1b171c91ad776b 100644 --- a/ports/libvpx/CONTROL +++ b/ports/libvpx/CONTROL @@ -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) diff --git a/ports/libvpx/portfile.cmake b/ports/libvpx/portfile.cmake index 1ff1d5c4198f35..fb6a161edbfbb4 100644 --- a/ports/libvpx/portfile.cmake +++ b/ports/libvpx/portfile.cmake @@ -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) diff --git a/ports/mp3lame/CONTROL b/ports/mp3lame/CONTROL index 8db5ca4006a2d2..a239128e45261b 100644 --- a/ports/mp3lame/CONTROL +++ b/ports/mp3lame/CONTROL @@ -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. diff --git a/ports/mp3lame/portfile.cmake b/ports/mp3lame/portfile.cmake index 92447757a31474..06aaf01b9b4e47 100644 --- a/ports/mp3lame/portfile.cmake +++ b/ports/mp3lame/portfile.cmake @@ -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") @@ -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() diff --git a/ports/mp3lame/remove_lame_init_old_from_symbol_list.patch b/ports/mp3lame/remove_lame_init_old_from_symbol_list.patch new file mode 100644 index 00000000000000..11d29b2eb1aa57 --- /dev/null +++ b/ports/mp3lame/remove_lame_init_old_from_symbol_list.patch @@ -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 diff --git a/ports/x264/CONTROL b/ports/x264/CONTROL index 15e35036a06430..73d74549a1c908 100644 --- a/ports/x264/CONTROL +++ b/ports/x264/CONTROL @@ -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) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index 5c716f0d1b4b1a..32bc1c02098b7b 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -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") diff --git a/ports/x265/CONTROL b/ports/x265/CONTROL index e9d704c74bbfb2..58fe1b99ebd028 100644 --- a/ports/x265/CONTROL +++ b/ports/x265/CONTROL @@ -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. diff --git a/ports/x265/portfile.cmake b/ports/x265/portfile.cmake index 3b3ecbba690c34..754e4127f2f3da 100644 --- a/ports/x265/portfile.cmake +++ b/ports/x265/portfile.cmake @@ -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() diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index 1689dc762186cc..90f452bd9be424 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -119,10 +119,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 diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 0d80e148cb9670..13405a0ce489b6 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -202,7 +202,7 @@ macro(_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags _SUFFIX) endmacro() function(vcpkg_configure_make) - # parse parameters such that semicolons in options arguments to COMMAND don't get erased + # parse parameters such that semicolons in options arguments to COMMAND don't get erased cmake_parse_arguments(PARSE_ARGV 0 _csc "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET" "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" @@ -481,7 +481,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) @@ -498,6 +497,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) @@ -677,7 +677,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)