Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ports/pthreads/fix-arm-macro.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/context.h b/context.h
index 33294c1..318b689 100644
--- a/context.h
+++ b/context.h
@@ -62,7 +62,7 @@
#endif

#if defined(_ARM_) || defined(ARM) || defined(_M_ARM) || defined(_M_ARM64)
-#define PTW32_PROGCTR(Context) ((Context).Pc)
+#define __PTW32_PROGCTR(Context) ((Context).Pc)
#endif

#if !defined (__PTW32_PROGCTR)
17 changes: 17 additions & 0 deletions ports/pthreads/fix-uwp-linkage.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/implement.h b/implement.h
index 1579376..3a7d29b 100644
--- a/implement.h
+++ b/implement.h
@@ -36,6 +36,12 @@
#if !defined(_IMPLEMENT_H)
#define _IMPLEMENT_H

+#if 1 // The condition should be `defined(__cplusplus_winrt)` when compile option is provided correctly.
+// porvide 2 static libs to resolve link error. 'kernel32' and 'windowsapp'
+#pragma comment(lib, "kernel32")
+#pragma comment(lib, "WindowsApp")
+#endif
+
#if !defined (__PTW32_CONFIG_H)
# error "config.h was not #included"
#endif
17 changes: 12 additions & 5 deletions ports/pthreads/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,29 @@ if(NOT VCPKG_TARGET_IS_WINDOWS)
return()
endif()

vcpkg_fail_port_install(MESSAGE "${PORT} does not currently support UWP platform nor ARM architectures" ON_TARGET "UWP" ON_ARCH "arm" )

set(PTHREADS4W_VERSION "3.0.0")

if(VCPKG_TARGET_IS_UWP)
list(APPEND PATCH_FILES fix-uwp-linkage.patch)
# Inject linker option using the `LINK` environment variable
# https://docs.microsoft.com/en-us/cpp/build/reference/linker-options
# https://docs.microsoft.com/en-us/cpp/build/reference/linking#link-environment-variables
set(ENV{LINK} "/APPCONTAINER")
endif()
if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
set(PATCH_FILE use-md.patch)
list(APPEND PATCH_FILES use-md.patch)
else()
set(PATCH_FILE use-mt.patch)
list(APPEND PATCH_FILES use-mt.patch)
endif()

vcpkg_from_sourceforge(
OUT_SOURCE_PATH SOURCE_PATH
REPO pthreads4w
FILENAME "pthreads4w-code-v${PTHREADS4W_VERSION}.zip"
SHA512 49e541b66c26ddaf812edb07b61d0553e2a5816ab002edc53a38a897db8ada6d0a096c98a9af73a8f40c94283df53094f76b429b09ac49862465d8697ed20013
PATCHES ${PATCH_FILE}
PATCHES
fix-arm-macro.patch
${PATCH_FILES}
)

find_program(NMAKE nmake REQUIRED)
Expand Down
5 changes: 2 additions & 3 deletions ports/pthreads/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "pthreads",
"version": "3.0.0",
"port-version": 7,
"port-version": 8,
"description": "pthreads for windows",
"homepage": "https://sourceware.org/pub/pthreads-win32/",
"supports": "!(uwp | arm | arm64)"
"homepage": "https://sourceware.org/pub/pthreads-win32/"
}
9 changes: 6 additions & 3 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ chromium-base:x64-linux=skip
civetweb:arm64-windows = skip
civetweb:arm-uwp = skip
civetweb:x64-uwp = skip
clamav:arm64-windows=fail
clblas:arm64-windows=fail
clblast:x64-linux=fail
clblast:x64-windows-static=fail
Expand Down Expand Up @@ -177,6 +178,8 @@ cudnn:arm-uwp=fail
cudnn:x64-uwp=fail
cudnn:x64-windows-static=fail
cudnn:x86-windows=fail
darknet:arm64-windows=fail
darknet:arm-uwp=fail
# Since pipeline cannot automatically install dbghelp dependency, skip this detection
dbghelp:arm-uwp=skip
dbghelp:arm64-windows=skip
Expand Down Expand Up @@ -333,6 +336,9 @@ fmilib:arm64-windows=fail
fmilib:arm-uwp=fail
fmilib:x64-linux=fail
fmilib:x64-uwp=fail
fontconfig:x64-uwp=fail
fontconfig:arm-uwp=fail
fontconfig:arm64-windows=fail
foonathan-memory:arm64-windows=fail
foonathan-memory:arm-uwp=fail
foonathan-memory:x64-uwp=fail
Expand Down Expand Up @@ -1285,9 +1291,6 @@ protobuf-c:x64-windows-static-md=fail
protobuf-c:x64-uwp=fail
protobuf-c:arm64-windows=fail
protobuf-c:arm-uwp=fail
pthreads:arm64-windows=fail
pthreads:arm-uwp=fail
pthreads:x64-uwp=fail
python2:arm64-windows=fail
python2:arm-uwp=fail
python2:x64-linux=fail
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4898,7 +4898,7 @@
},
"pthreads": {
"baseline": "3.0.0",
"port-version": 7
"port-version": 8
},
"pugixml": {
"baseline": "1.11.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/pthreads.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e03999fb593f35daefdea06f7c99af233f3a7f3d",
"version": "3.0.0",
"port-version": 8
},
{
"git-tree": "f76c9c365aff8cf663941bbe6dac93379e856345",
"version": "3.0.0",
Expand Down