add proj version and add gdal package (#1573)
* add package proj 8.2.1 * add package gdal * add gdal test * fix openjpeg version tag, add gdal package * fix about pr * Update xmake.lua * Update xmake.lua * Update xmake.lua * modify gdal config param * Update xmake.lua * Update xmake.lua * Update xmake.lua * add openjpeg patch for windows arm64 * add openjpeg patch for windows arm64 * update gdal xmake.lua * update gdal xmake.lua Co-authored-by: ruki <waruqi@gmail.com>pull/1584/head
parent
deb0bf9eb0
commit
25f20be0f5
4 changed files with 63 additions and 7 deletions
@ -0,0 +1,34 @@ |
||||
package("gdal") |
||||
set_homepage("https://gdal.org/") |
||||
set_description("L is a translator library for raster and vector geospatial data formats that is released under an MIT style Open Source License by the Open Source Geospatial Foundation") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/OSGeo/gdal/releases/download/v$(version)/gdal-$(version).tar.gz") |
||||
add_versions("3.5.1", "7c4406ca010dc8632703a0a326f39e9db25d9f1f6ebaaeca64a963e3fac123d1") |
||||
|
||||
add_configs("apps", {description = "Build GDAL applications.", default = false, type = "boolean"}) |
||||
add_deps("cmake", "proj", "openjpeg") |
||||
|
||||
if is_plat("windows") then |
||||
add_syslinks("wsock32", "ws2_32") |
||||
end |
||||
|
||||
on_install("windows|x86", "windows|x64", "macosx", "linux", function (package) |
||||
local configs = {"-DBUILD_TESTING=OFF", "-DGDAL_USE_EXTERNAL_LIBS=OFF", "-DGDAL_USE_OPENJPEG=ON", |
||||
"-DBUILD_JAVA_BINDINGS=OFF", "-DBUILD_CSHARP_BINDINGS=OFF", "-DBUILD_PYTHON_BINDINGS=OFF"} |
||||
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")) |
||||
table.insert(configs, "-DBUILD_APPS=" .. (package:config("apps") and "ON" or "OFF")) |
||||
import("package.tools.cmake").install(package, configs, {packagedeps = {"openjpeg", "proj"}}) |
||||
if package:config("apps") then |
||||
package:addenv("PATH", "bin") |
||||
end |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
#include <ogrsf_frmts.h> |
||||
void test(int argc, char** argv) { |
||||
GDALAllRegister(); |
||||
}]]}, {configs = {languages = "c++11"}, includes = "ogrsf_frmts.h"})) |
||||
end) |
@ -0,0 +1,11 @@ |
||||
--- a/src/lib/openjp2/ht_dec.c
|
||||
+++ b/src/lib/openjp2/ht_dec.c
|
||||
@@ -69,7 +69,7 @@ static OPJ_BOOL only_cleanup_pass_is_decoded = OPJ_FALSE;
|
||||
static INLINE
|
||||
OPJ_UINT32 population_count(OPJ_UINT32 val)
|
||||
{
|
||||
-#ifdef OPJ_COMPILER_MSVC
|
||||
+#if defined(OPJ_COMPILER_MSVC) && (defined(_M_IX86) || defined(_M_AMD64))
|
||||
return (OPJ_UINT32)__popcnt(val);
|
||||
#elif (defined OPJ_COMPILER_GNUC)
|
||||
return (OPJ_UINT32)__builtin_popcount(val);
|
Loading…
Reference in new issue