fix gdal compile on msvc debug mode (#1584)

* fix gdal compile on msvc debug mode

* update gdal/xmake.lua

* update gdal/xmake.lua

* update gdal/xmake.lua

* Update xmake.lua

* Update xmake.lua

Co-authored-by: ruki <waruqi@gmail.com>
pull/1586/head
Scially 2 years ago committed by GitHub
parent c0191c950c
commit 6272b6e18b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      packages/g/gdal/xmake.lua

@ -1,6 +1,6 @@
package("gdal") package("gdal")
set_homepage("https://gdal.org/") 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_description("GDAL is a translator library for raster and vector geospatial data formats by the Open Source Geospatial Foundation")
set_license("MIT") set_license("MIT")
add_urls("https://github.com/OSGeo/gdal/releases/download/v$(version)/gdal-$(version).tar.gz") add_urls("https://github.com/OSGeo/gdal/releases/download/v$(version)/gdal-$(version).tar.gz")
@ -12,14 +12,21 @@ package("gdal")
if is_plat("windows") then if is_plat("windows") then
add_syslinks("wsock32", "ws2_32") add_syslinks("wsock32", "ws2_32")
end end
on_install("windows|x86", "windows|x64", "macosx", "linux", function (package) on_install("windows|x86", "windows|x64", "macosx", "linux", function (package)
local configs = {"-DBUILD_TESTING=OFF", "-DGDAL_USE_EXTERNAL_LIBS=OFF", "-DGDAL_USE_OPENJPEG=ON", 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"} "-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, "-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_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DBUILD_APPS=" .. (package:config("apps") 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"}})
--fix gdal compile on msvc debug mode
local cxflags
if package:debug() and package:is_plat("windows") then
cxflags = "/FS"
end
import("package.tools.cmake").install(package, configs,
{cxflags = cxflags, packagedeps = {"openjpeg", "proj"}})
if package:config("apps") then if package:config("apps") then
package:addenv("PATH", "bin") package:addenv("PATH", "bin")
end end

Loading…
Cancel
Save