[many ports] Support building with MinGW toolchain (#8940)

* Some package fixes necessary to build with MinGW toolchain

* [libraqm] Fix build error caused by trying to write to source directory

* [tmxparser] Fix build failure when tmx port is intalled before tmxparser port

System include path was added first on compiler command line. This leads to
build failure when there is a tmx.h header file in system include path.

* [qt5-base][angle] Trigger CI rebuild

* [kd-soap] Fix build error

* Update ci.baseline

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
This commit is contained in:
Todor Prokopov 2020-02-12 03:30:03 +02:00 committed by GitHub
parent 5f12ffae8d
commit f478be7479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 111 additions and 43 deletions

View File

@ -1,5 +1,5 @@
Source: angle
Version: 2019-12-31
Version: 2019-12-31-1
Homepage: https://github.com/google/angle
Description: A conformant OpenGL ES implementation for Windows, Mac and Linux.
The goal of ANGLE is to allow users of multiple operating systems to seamlessly run WebGL and other OpenGL ES content by translating OpenGL ES API calls to one of the hardware-supported APIs available for that platform. ANGLE currently provides translation from OpenGL ES 2.0 and 3.0 to desktop OpenGL, OpenGL ES, Direct3D 9, and Direct3D 11. Support for translation from OpenGL ES to Vulkan is underway, and future plans include compute shader support (ES 3.1) and MacOS support.

View File

@ -36,10 +36,18 @@ endif()
if(APPLE)
list(APPEND B2_OPTIONS target-os=darwin toolset=clang)
elseif(WIN32)
list(APPEND B2_OPTIONS target-os=windows toolset=gcc)
else()
list(APPEND B2_OPTIONS target-os=linux toolset=gcc)
endif()
if(WIN32)
list(APPEND B2_OPTIONS threadapi=win32)
else()
list(APPEND B2_OPTIONS threadapi=pthread)
endif()
# Properly handle compiler and linker flags passed by VCPKG
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
@ -156,7 +164,6 @@ add_custom_target(boost ALL
architecture=x86
threading=multi
threadapi=pthread
debug-symbols=on
stage

View File

@ -1,4 +1,4 @@
Source: bzip2
Version: 1.0.6-4
Version: 1.0.6-5
Homepage: http://www.bzip.org/
Description: High-quality data compressor.

View File

@ -0,0 +1,12 @@
diff -urN bzip2-1.0.6-orig/bzip2.c bzip2-1.0.6/bzip2.c
--- bzip2-1.0.6-orig/bzip2.c 2010-09-11 02:04:53.000000000 +0300
+++ bzip2-1.0.6/bzip2.c 2019-11-04 11:40:52.230652175 +0200
@@ -128,7 +128,7 @@
#if BZ_LCCWIN32
# include <io.h>
# include <fcntl.h>
-# include <sys\stat.h>
+# include <sys/stat.h>
# define NORETURN /**/
# define PATH_SEP '\\'

View File

@ -11,6 +11,7 @@ vcpkg_extract_source_archive_ex(
REF ${BZIP2_VERSION}
PATCHES
fix-import-export-macros.patch
fix-windows-include.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

View File

@ -1,5 +1,5 @@
Source: ffmpeg
Version: 4.2-4
Version: 4.2-5
Build-Depends: zlib
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.

View File

@ -51,7 +51,7 @@ endif()
# Platform dependent libraries required by FFMPEG
if(WIN32)
if(NOT CYGWIN)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 Secur32 bcrypt)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 secur32 bcrypt)
endif()
else()
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS m)

View File

@ -1,4 +1,4 @@
Source: glew
Version: 2.1.0-6
Version: 2.1.0-7
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

View File

@ -26,6 +26,7 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/glew)
if(VCPKG_TARGET_IS_WINDOWS)
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")
@ -46,6 +47,7 @@ endif()
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/libglew32d.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libglew32d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/glew32d.lib)
endif()
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)

View File

@ -1,5 +1,5 @@
Source: kd-soap
Version: 1.8.0
Version: 1.8.0-1
Description: A Qt-based client-side and server-side SOAP component
Homepage: https://www.kdab.com/products/kd-soap
Build-Depends: qt5-base

View File

@ -1,5 +1,3 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KDAB/KDSoap
@ -19,8 +17,11 @@ vcpkg_install_cmake()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/kd-soap RENAME copyright)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/kdwsdl2cpp.exe ${CURRENT_PACKAGES_DIR}/tools/kdwsdl2cpp.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/kdwsdl2cpp.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/kdwsdl2cpp${VCPKG_TARGET_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/kdwsdl2cpp${VCPKG_TARGET_EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/kdwsdl2cpp${VCPKG_TARGET_EXECUTABLE_SUFFIX})
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)

View File

@ -13,10 +13,11 @@ find_path(HARFBUZZ_INCLUDE_DIRS
PATH_SUFFIXES harfbuzz)
find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/raqm-version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/raqm-version.h)
configure_file(src/raqm-version.h.in src/raqm-version.h)
add_library(raqm ${CMAKE_CURRENT_SOURCE_DIR}/src/raqm.c ${CMAKE_CURRENT_SOURCE_DIR}/src/raqm.h ${CMAKE_CURRENT_SOURCE_DIR}/src/raqm-version.h)
add_library(raqm src/raqm.c src/raqm.h src/raqm-version.h)
target_include_directories(raqm PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/src)
target_include_directories(raqm SYSTEM PUBLIC ${FREETYPE_ADDITIONAL_INCLUDE_DIRS})
target_include_directories(raqm SYSTEM PUBLIC ${FREETYPE_INCLUDE_DIRS})
target_include_directories(raqm SYSTEM PUBLIC ${HARFBUZZ_INCLUDE_DIRS})
@ -34,4 +35,4 @@ install(TARGETS raqm
set(RAQM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(RAQM_LIBRARY raqm)
set(RAQM_LIBRARIES ${HARFBUZZ_LIBRARY} ${FRIBIDI_LIBRARY} ${RAQM_LIBRARY})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/raqm.h ${CMAKE_CURRENT_SOURCE_DIR}/src/raqm-version.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/raqm.h ${CMAKE_CURRENT_BINARY_DIR}/src/raqm-version.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)

View File

@ -1,4 +1,4 @@
Source: libraqm
Version: 0.7.0
Version: 0.7.0-1
Description: A library for complex text layout
Build-Depends: freetype, harfbuzz, fribidi

View File

@ -1,5 +1,5 @@
Source: qt5-base
Version: 5.12.5-8
Version: 5.12.5-9
Homepage: https://www.qt.io/
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows)

View File

@ -1,4 +1,4 @@
Source: tmxparser
Version: 2.1.0-3
Version: 2.1.0-4
Description: C++11 library for parsing the maps generated by the Map Editor called Tiled.
Build-Depends: zlib, tinyxml2

View File

@ -0,0 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9d06cb4..593bbfd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,8 @@ endif (NOT USE_MINIZ)
set(EXAMPLE_CFLAGS "-std=c++11 -pedantic -Werror -Wall -g")
#include_directories("${PROJECT_SOURCE_DIR}/include")
+include_directories("${PROJECT_BINARY_DIR}")
+include_directories("${PROJECT_SOURCE_DIR}/src")
add_library(tmxparser_static STATIC ${SOURCES} ${HEADERS})
set_target_properties(tmxparser_static PROPERTIES
@@ -67,8 +69,6 @@ add_executable(run_tests test/test.cpp)
set_target_properties(run_tests PROPERTIES
COMPILE_FLAGS ${EXAMPLE_CFLAGS})
target_link_libraries(run_tests tmxparser ${TINYXML2_LIBRARIES})
-include_directories("${PROJECT_BINARY_DIR}")
-include_directories("${PROJECT_SOURCE_DIR}/src")
install(FILES ${HEADERS} DESTINATION include/tmxparser)
install(TARGETS tmxparser tmxparser_static DESTINATION lib)

View File

@ -4,6 +4,8 @@ vcpkg_from_github(
REF v2.1.0
HEAD_REF master
SHA512 011cce3bb98057f8e2a0a82863fedb7c4b9e41324d5cfa6daade4d000c3f6c8c157da7b153f7f2564ecdefe8019fc8446c9b1b8a675be04329b04a0891ee1c27
PATCHES
fix_include_paths.patch
)
vcpkg_configure_cmake(

View File

@ -1,4 +1,4 @@
Source: zlib
Version: 1.2.11-5
Version: 1.2.11-6
Homepage: https://www.zlib.net/
Description: A compression library

View File

@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fe939d..8d2f5f1 100644
index 0fe939d..a1291d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ set(VERSION "1.2.11")
@ -10,24 +10,56 @@ index 0fe939d..8d2f5f1 100644
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
@@ -211,7 +212,15 @@ elseif(BUILD_SHARED_LIBS AND WIN32)
@@ -124,9 +125,11 @@ set(ZLIB_SRCS
)
if(NOT MINGW)
- set(ZLIB_DLL_SRCS
- win32/zlib1.rc # If present will override custom build rule below.
- )
+ if(BUILD_SHARED_LIBS)
+ set(ZLIB_DLL_SRCS
+ win32/zlib1.rc # If present will override custom build rule below.
+ )
+ endif()
endif()
if(CMAKE_COMPILER_IS_GNUCC)
@@ -180,11 +183,12 @@ if(MINGW)
-I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
- set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
+ if(BUILD_SHARED_LIBS)
+ set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
+ endif()
endif(MINGW)
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)
@@ -201,7 +205,7 @@ endif()
if(UNIX)
# On unix-like platforms the library is almost always called libz
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
if(NOT APPLE)
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
@@ -211,7 +215,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32)
endif()
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
- install(TARGETS zlib zlibstatic
+ if (BUILD_SHARED_LIBS)
+ set(ZLIB_TARGETS zlib)
+ set_target_properties(zlibstatic PROPERTIES EXCLUDE_FROM_ALL ON)
+ else()
+ set(ZLIB_TARGETS zlibstatic)
+ set_target_properties(zlib PROPERTIES EXCLUDE_FROM_ALL ON)
+ endif()
+
+ install(TARGETS ${ZLIB_TARGETS}
+ install(TARGETS zlib
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
@@ -230,6 +239,7 @@ endif()
@@ -230,6 +234,7 @@ endif()
# Example binaries
#============================================================================
@ -35,7 +67,7 @@ index 0fe939d..8d2f5f1 100644
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)
@@ -247,3 +257,4 @@ if(HAVE_OFF64_T)
@@ -247,3 +252,4 @@ if(HAVE_OFF64_T)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()

View File

@ -31,16 +31,6 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
# Both dynamic and static are built, so keep only the one needed
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/zlibstatic.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/zlibstatic.lib ${CURRENT_PACKAGES_DIR}/lib/zlib.lib)
endif()
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/zlibstaticd.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/zlibstaticd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/zlibd.lib)
endif()
endif()
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zlib RENAME copyright)
vcpkg_copy_pdbs()

View File

@ -663,9 +663,7 @@ jemalloc:x64-uwp=fail
jemalloc:x64-windows-static=fail
jinja2cpplight:arm-uwp=fail
jinja2cpplight:x64-uwp=fail
kd-soap:x64-linux=fail
kd-soap:x64-osx=fail
kd-soap:x64-windows-static=fail
keystone:arm64-windows=fail
keystone:arm-uwp=fail
keystone:x64-uwp=fail