aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordriver1998 <driver1998.ms@outlook.com>2019-05-04 07:21:44 +0800
committerGriffin Downs <35574547+grdowns@users.noreply.github.com>2019-05-03 16:21:44 -0700
commit5ea9105f15af8d79d257d8439dd81420d9c85643 (patch)
treef751e01de27a92dfdb391d55f7780c7fe27af196
parent5b2759be83d06c8089c6067c408dc946452d772d (diff)
downloadvcpkg-5ea9105f15af8d79d257d8439dd81420d9c85643.tar.gz
vcpkg-5ea9105f15af8d79d257d8439dd81420d9c85643.zip
[glib] arm/arm64 windows support (#6116)
* glib port update for arm/arm64 windows * bump glib version to 2.52.3-14
-rw-r--r--ports/glib/CMakeLists.txt13
-rw-r--r--ports/glib/CONTROL2
-rw-r--r--ports/glib/arm64-defines.patch78
-rw-r--r--ports/glib/fix-arm-builds.patch46
-rw-r--r--ports/glib/portfile.cmake2
5 files changed, 137 insertions, 4 deletions
diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt
index 6e9e62a4f..49e4e1112 100644
--- a/ports/glib/CMakeLists.txt
+++ b/ports/glib/CMakeLists.txt
@@ -4,6 +4,9 @@ project(glib C)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)
+if(MSVC)
+ add_compile_options(/utf-8)
+endif()
set(GLIB_DLL_SUFFIX 2)
set(GLIB_LIB_SUFFIX 2.0)
@@ -131,7 +134,7 @@ target_compile_definitions(glib PRIVATE GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIB
target_link_libraries(glib PRIVATE ${PCRE_LIBRARY} unofficial::iconv::libiconv unofficial::iconv::libcharset ${LIBINTL_LIBRARY})
if(WIN32)
target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE)
- target_link_libraries(glib PRIVATE ws2_32 winmm)
+ target_link_libraries(glib PRIVATE ws2_32 winmm advapi32 ole32 shell32)
else()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
@@ -246,7 +249,7 @@ target_compile_definitions(gio PRIVATE GIO_COMPILATION G_LOG_DOMAIN="GLib-GIO")
target_link_libraries(gio PRIVATE glib gmodule gobject ZLIB::ZLIB ${LIBRESOLV_LIBRARY} ${LIBINTL_LIBRARY})
target_include_directories(gio PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gio> $<INSTALL_INTERFACE:include/gio>)
if(WIN32)
- target_link_libraries(gio PRIVATE ws2_32 shlwapi dnsapi iphlpapi)
+ target_link_libraries(gio PRIVATE ws2_32 shlwapi dnsapi iphlpapi advapi32 shell32)
elseif(APPLE)
target_link_libraries(gio PRIVATE xdgmime kqueue)
else()
@@ -262,7 +265,11 @@ endforeach()
macro(add_glib_tool TOOL_NAME)
add_executable(${TOOL_NAME} ${ARGN})
- target_link_libraries(${TOOL_NAME} glib ${LIBINTL_LIBRARY})
+ if(WIN32)
+ target_link_libraries(${TOOL_NAME} glib ${LIBINTL_LIBRARY} shell32)
+ else()
+ target_link_libraries(${TOOL_NAME} glib ${LIBINTL_LIBRARY})
+ endif()
target_compile_definitions(${TOOL_NAME} PRIVATE GLIB_COMPILATION)
list(APPEND GLIB_TOOLS ${TOOL_NAME})
endmacro()
diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL
index 37e2d1e91..9197a6037 100644
--- a/ports/glib/CONTROL
+++ b/ports/glib/CONTROL
@@ -1,4 +1,4 @@
Source: glib
-Version: 2.52.3-13-1
+Version: 2.52.3-14-1
Description: Portable, general-purpose utility library.
Build-Depends: zlib, pcre, libffi, gettext, libiconv
diff --git a/ports/glib/arm64-defines.patch b/ports/glib/arm64-defines.patch
new file mode 100644
index 000000000..c1b5181c6
--- /dev/null
+++ b/ports/glib/arm64-defines.patch
@@ -0,0 +1,78 @@
+diff --git a/config.h.win32 b/config.h.win32
+index 999641d65..531843e0e 100644
+--- a/config.h.win32
++++ b/config.h.win32
+@@ -728,7 +728,7 @@
+
+ /* The size of `void *', as computed by sizeof. */
+ #ifdef _MSC_VER
+-#if (defined(_M_X64) || defined(_M_AMD64))
++#if (defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64))
+ #define SIZEOF_VOID_P 8
+ #elif (defined(_M_IX86))
+ #define SIZEOF_VOID_P 4
+diff --git a/config.h.win32.in b/config.h.win32.in
+index eaf7e2818..049c5e9f4 100644
+--- a/config.h.win32.in
++++ b/config.h.win32.in
+@@ -728,7 +728,7 @@
+
+ /* The size of `void *', as computed by sizeof. */
+ #ifdef _MSC_VER
+-#if (defined(_M_X64) || defined(_M_AMD64))
++#if (defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64))
+ #define SIZEOF_VOID_P 8
+ #elif (defined(_M_IX86))
+ #define SIZEOF_VOID_P 4
+diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
+index 9b3619cb1..6400572a2 100644
+--- a/gio/gdbusaddress.c
++++ b/gio/gdbusaddress.c
+@@ -1469,7 +1469,7 @@ get_session_address_dbus_launch (GError **error)
+ wcscat (args, rundll_path);
+ wcscat (args, L"\" ");
+ wcscat (args, gio_path_short);
+-#if defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64)
++#if defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64)
+ wcscat (args, L",g_win32_run_session_bus");
+ #elif defined (_MSC_VER)
+ wcscat (args, L",_g_win32_run_session_bus@16");
+diff --git a/glib/gatomic.c b/glib/gatomic.c
+index e3e49fab4..e257e4377 100644
+--- a/glib/gatomic.c
++++ b/glib/gatomic.c
+@@ -474,7 +474,7 @@ gsize
+ #elif defined (G_PLATFORM_WIN32)
+
+ #include <windows.h>
+-#if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) && !(defined _MSC_VER && _MSC_VER <= 1200)
++#if !defined(_M_ARM64) && !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) && !(defined _MSC_VER && _MSC_VER <= 1200)
+ #define InterlockedAnd _InterlockedAnd
+ #define InterlockedOr _InterlockedOr
+ #define InterlockedXor _InterlockedXor
+diff --git a/glib/glibconfig.h.win32 b/glib/glibconfig.h.win32
+index d9f893a15..b75a86f10 100644
+--- a/glib/glibconfig.h.win32
++++ b/glib/glibconfig.h.win32
+@@ -68,7 +68,7 @@ typedef unsigned __int64 guint64;
+ #define G_GINT64_FORMAT "I64i"
+ #define G_GUINT64_FORMAT "I64u"
+
+-#if defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64)
++#if defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64)
+
+ #define GLIB_SIZEOF_VOID_P 8
+ #define GLIB_SIZEOF_LONG 4
+diff --git a/glib/glibconfig.h.win32.in b/glib/glibconfig.h.win32.in
+index 9a91c5e96..f0b88c976 100644
+--- a/glib/glibconfig.h.win32.in
++++ b/glib/glibconfig.h.win32.in
+@@ -68,7 +68,7 @@ typedef unsigned __int64 guint64;
+ #define G_GINT64_FORMAT "I64i"
+ #define G_GUINT64_FORMAT "I64u"
+
+-#if defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64)
++#if defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64)
+
+ #define GLIB_SIZEOF_VOID_P 8
+ #define GLIB_SIZEOF_LONG 4
diff --git a/ports/glib/fix-arm-builds.patch b/ports/glib/fix-arm-builds.patch
new file mode 100644
index 000000000..257ee75c6
--- /dev/null
+++ b/ports/glib/fix-arm-builds.patch
@@ -0,0 +1,46 @@
+diff --git a/gio/tests/plugin_resources.c b/gio/tests/plugin_resources.c
+index 4c1b0214b..bbfc7ae07 100644
+--- a/gio/tests/plugin_resources.c
++++ b/gio/tests/plugin_resources.c
+@@ -80,13 +80,13 @@ GResource *_g_plugin_get_resource (void)
+ */
+
+ /* We need to account for differences between the mangling of symbols
+- * for Win32 (x86) and x64 programs, as symbols on Win32 are prefixed
+- * with an underscore but symbols on x64 are not.
++ * for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed
++ * with an underscore but symbols on x64/ARM/ARM64 are not.
+ */
+-#ifdef _WIN64
+-#define G_MSVC_SYMBOL_PREFIX ""
+-#else
++#ifdef _M_IX86
+ #define G_MSVC_SYMBOL_PREFIX "_"
++#else
++#define G_MSVC_SYMBOL_PREFIX ""
+ #endif
+
+ #define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
+diff --git a/glib/gconstructor.h b/glib/gconstructor.h
+index dccb0314c..fa1139302 100644
+--- a/glib/gconstructor.h
++++ b/glib/gconstructor.h
+@@ -40,13 +40,13 @@
+ */
+
+ /* We need to account for differences between the mangling of symbols
+- * for Win32 (x86) and x64 programs, as symbols on Win32 are prefixed
+- * with an underscore but symbols on x64 are not.
++ * for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed
++ * with an underscore but symbols on x64/ARM/ARM64 are not.
+ */
+-#ifdef _WIN64
+-#define G_MSVC_SYMBOL_PREFIX ""
+-#else
++#ifdef _M_IX86
+ #define G_MSVC_SYMBOL_PREFIX "_"
++#else
++#define G_MSVC_SYMBOL_PREFIX ""
+ #endif
+
+ #define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake
index da220d067..44a499320 100644
--- a/ports/glib/portfile.cmake
+++ b/ports/glib/portfile.cmake
@@ -22,6 +22,8 @@ vcpkg_extract_source_archive_ex(
REF ${GLIB_VERSION}
PATCHES
use-libiconv-on-windows.patch
+ arm64-defines.patch
+ fix-arm-builds.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})