Skip to content

Commit

Permalink
proj: fix linux syslinks (#5702)
Browse files Browse the repository at this point in the history
* fix proj

* clean code

---------

Co-authored-by: star9029 <[email protected]>
  • Loading branch information
Elite-stay and star-hengxing authored Nov 8, 2024
1 parent 4df0ab0 commit 9652581
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions packages/p/proj/xmake.lua
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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")
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 9652581

Please sign in to comment.