From b94d6e6ced33576a1ad96c7f6e701788c6f49211 Mon Sep 17 00:00:00 2001 From: Yan Pujante Date: Sun, 22 Dec 2024 11:58:24 -0800 Subject: [PATCH] [contrib.glfw3] added support for pthread (#23245) Following some user request, I made the necessary changes to the code as well as the port file to add pthread support. I followed the pattern in other ports (like sdl2) for adding the `-pthread` option when `settings.PTHREAD` is defined and used the same extension for the library name (`-mt`). --- tools/ports/contrib/glfw3.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/ports/contrib/glfw3.py b/tools/ports/contrib/glfw3.py index 25731bac3324f..838f061953aa9 100644 --- a/tools/ports/contrib/glfw3.py +++ b/tools/ports/contrib/glfw3.py @@ -6,8 +6,8 @@ import os from typing import Union, Dict -TAG = '3.4.0.20241004' -HASH = 'd2745e9f621090b6f78e1c8122d1e6a2e7e774d27799f14945ddcfd543aedeac0e6acdecf42fe74f9ecdbc25aa3599372798ecfc55ddd941661e0628c494cda6' +TAG = '3.4.0.20241221' +HASH = 'e977fcab4747085fead33ab365ece02d6185564401f4904583095e45d3599d2be9315398f8b414b0da8ee954964a1649d2932d378fc8bf96caa986b43b3ae5e7' # contrib port information (required) URL = 'https://github.com/pongasoft/emscripten-glfw' @@ -44,6 +44,7 @@ def get_lib_name(settings): ('-nw' if opts['disableWarning'] else '') + ('-nj' if opts['disableJoystick'] else '') + ('-sw' if opts['disableMultiWindow'] else '') + + ('-mt' if settings.PTHREADS else '') + '.a') @@ -71,6 +72,9 @@ def create(final): if opts['disableMultiWindow']: flags += ['-DEMSCRIPTEN_GLFW3_DISABLE_MULTI_WINDOW_SUPPORT'] + if settings.PTHREADS: + flags += ['-pthread'] + ports.build_port(source_path, final, port_name, includes=source_include_paths, flags=flags) return [shared.cache.get_lib(get_lib_name(settings), create, what='port')]