From 96525815f1405ebfb60354b4c41625b28c42fd98 Mon Sep 17 00:00:00 2001 From: Elite-stay <344233108@qq.com> Date: Fri, 8 Nov 2024 14:45:51 +0800 Subject: [PATCH] proj: fix linux syslinks (#5702) * fix proj * clean code --------- Co-authored-by: star9029 --- packages/p/proj/xmake.lua | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/p/proj/xmake.lua b/packages/p/proj/xmake.lua index c6e078178..e714d6ad1 100644 --- a/packages/p/proj/xmake.lua +++ b/packages/p/proj/xmake.lua @@ -1,5 +1,4 @@ package("proj") - set_homepage("https://proj.org/index.html") set_description("PROJ is a generic coordinate transformation software that transforms geospatial coordinates from one coordinate reference system (CRS) to another.") set_license("MIT") @@ -13,14 +12,15 @@ package("proj") add_configs("tiff", {description = "Enable TIFF support.", default = false, type = "boolean"}) add_configs("curl", {description = "Enable Curl support.", default = false, type = "boolean"}) - add_deps("cmake", "sqlite3") - add_deps("nlohmann_json", {configs = {cmake = true}}) - if is_plat("windows") then + if is_plat("windows", "mingw") then add_syslinks("shell32", "ole32") - elseif is_plat("linux") then - add_syslinks("pthread") + elseif is_plat("linux", "bsd") then + add_syslinks("dl", "pthread") end + add_deps("cmake", "sqlite3") + add_deps("nlohmann_json", {configs = {cmake = true}}) + on_load(function (package) if package:config("tiff") then package:add("deps", "libtiff") @@ -31,6 +31,10 @@ package("proj") if package:config("apps") then package:addenv("PATH", "bin") end + + if not package:config("shared") then + package:add("defines", "PROJ_DLL=") + end end) on_install("!wasm and (!android or android@!windows)", function (package) @@ -55,11 +59,6 @@ package("proj") else import("package.tools.cmake").install(package, configs) end - - if not package:config("shared") then - -- public compile definitions in CMake - package:add("defines", "PROJ_DLL=") - end end) on_test(function (package)