From 4350a4ca9eb53634a224fef5e5ce28a756117f51 Mon Sep 17 00:00:00 2001 From: Shiwei Wang <4977975+wsw0108@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:55:12 +0800 Subject: [PATCH] Make package cpr support MinGW@Windows (#1331) * Make package cpr support MinGW * cpr: use same package platforms as libcurl * cpr: fix usage of 'is_plat()' * cpr: only support mingw@windows --- packages/c/cpr/xmake.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/c/cpr/xmake.lua b/packages/c/cpr/xmake.lua index 0ccb29a8a..fcb042e16 100644 --- a/packages/c/cpr/xmake.lua +++ b/packages/c/cpr/xmake.lua @@ -11,7 +11,10 @@ package("cpr") add_versions("1.8.3", "0784d4c2dbb93a0d3009820b7858976424c56578ce23dcd89d06a1d0bf5fd8e2") add_deps("cmake", "libcurl") - on_install("linux", "macosx", "windows", function (package) + if is_plat("mingw") then + add_syslinks("pthread") + end + on_install("linux", "macosx", "windows", "mingw@windows", function (package) local configs = {"-DCPR_BUILD_TESTS=OFF", "-DCPR_ENABLE_SSL=ON", "-DCPR_FORCE_USE_SYSTEM_CURL=ON"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))