From 154fd28c9cc36b09a59bad2fa9eb56e222f25678 Mon Sep 17 00:00:00 2001 From: star9029 Date: Thu, 21 Nov 2024 17:14:44 +0800 Subject: [PATCH] fix mingw shared --- packages/l/libcoro/xmake.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/l/libcoro/xmake.lua b/packages/l/libcoro/xmake.lua index 65eeee49c..b0e908a83 100644 --- a/packages/l/libcoro/xmake.lua +++ b/packages/l/libcoro/xmake.lua @@ -25,6 +25,10 @@ package("libcoro") if package:config("tls") then package:add("deps", "openssl") end + + if not package:config("shared") then + package:add("defines", "CORO_STATIC_DEFINE") + end end) on_install(function (package) @@ -37,7 +41,12 @@ package("libcoro") table.insert(configs, "-DLIBCORO_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DLIBCORO_FEATURE_NETWORKING=" .. (package:config("networking") and "ON" or "OFF")) table.insert(configs, "-DLIBCORO_FEATURE_TLS=" .. (package:config("tls") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + + local opt = {} + if package:is_plat("mingw") and package:config("shared") then + opt.shflags = "-Wl,--export-all-symbols" + end + import("package.tools.cmake").install(package, configs, opt) if package:is_plat("windows") and package:is_debug() then local dir = package:installdir(package:config("shared") and "bin" or "lib")