From fe19c5e41167336d8b9d52f3dff44caa72fd6bfa Mon Sep 17 00:00:00 2001 From: Todor Prokopov Date: Fri, 31 Jul 2020 08:37:02 +0300 Subject: Mingw port fixes (#12103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [openal-soft] MinGW build fixes * [glew] MinGW build fixes * [protobuf] MinGW build fixes * [protobuf] Update to 3.12.3 * [protobuf] Preserve existing cross-compilation behavior (e.g. android) Co-authored-by: Robert Schumacher Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> --- ports/glew/CONTROL | 2 +- ports/glew/portfile.cmake | 2 +- ports/openal-soft/CONTROL | 2 +- ports/openal-soft/fix-mingw-build.patch | 14 ++++++++++++++ ports/openal-soft/portfile.cmake | 1 + ports/protobuf/portfile.cmake | 2 +- 6 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 ports/openal-soft/fix-mingw-build.patch diff --git a/ports/glew/CONTROL b/ports/glew/CONTROL index 9a7fd7e9c..6409f87e7 100644 --- a/ports/glew/CONTROL +++ b/ports/glew/CONTROL @@ -1,4 +1,4 @@ Source: glew -Version: 2.1.0-7 +Version: 2.1.0-8 Description: The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. Homepage: https://github.com/nigels-com/glew diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 504a91dcf..de436818c 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -26,7 +26,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/glew) -if(VCPKG_TARGET_IS_WINDOWS) +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) set(_targets_cmake_files) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") list(APPEND _targets_cmake_files "${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-debug.cmake") diff --git a/ports/openal-soft/CONTROL b/ports/openal-soft/CONTROL index 6b84e63ff..a139fb9e8 100644 --- a/ports/openal-soft/CONTROL +++ b/ports/openal-soft/CONTROL @@ -1,6 +1,6 @@ Source: openal-soft Version: 1.20.1 -Port-Version: 4 +Port-Version: 5 Homepage: https://github.com/kcat/openal-soft Description: OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API. Supports: !uwp diff --git a/ports/openal-soft/fix-mingw-build.patch b/ports/openal-soft/fix-mingw-build.patch new file mode 100644 index 000000000..ffb2db303 --- /dev/null +++ b/ports/openal-soft/fix-mingw-build.patch @@ -0,0 +1,14 @@ +diff --git a/common/alstring.h b/common/alstring.h +index 194e54a1..5a5f87ed 100644 +--- a/common/alstring.h ++++ b/common/alstring.h +@@ -4,6 +4,9 @@ + #include + #include + ++// This fixes MinGW link errors. It defines strcasecmp and strncasecmp in string.h. ++#include ++ + #include "almalloc.h" + + diff --git a/ports/openal-soft/portfile.cmake b/ports/openal-soft/portfile.cmake index 5b6c8067c..31ebc6bae 100644 --- a/ports/openal-soft/portfile.cmake +++ b/ports/openal-soft/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( PATCHES dont-export-symbols-in-static-build.patch fix-arm-builds.patch + fix-mingw-build.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 2c4497fe0..4bfc11644 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_from_github( if(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(protobuf_BUILD_PROTOC_BINARIES OFF) -elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME) +elseif(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_IS_MINGW AND NOT (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)) set(protobuf_BUILD_PROTOC_BINARIES OFF) else() set(protobuf_BUILD_PROTOC_BINARIES ON) -- cgit v1.2.3