update mongo-c-driver; add mongo-cxx-driver (#963)

pull/966/head
fasiondog 3 years ago committed by GitHub
parent ea2e194fd4
commit 5b5f46f90f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/m/mongo-c-driver/xmake.lua
  2. 38
      packages/m/mongo-cxx-driver/xmake.lua

@ -6,6 +6,7 @@ package("mongo-c-driver")
add_urls("https://github.com/mongodb/mongo-c-driver/archive/$(version).zip",
"https://github.com/mongodb/mongo-c-driver.git")
add_versions("1.20.1", "3a856e1c40b02fc5160cb7b39594d654f3076eeb671829b867971e7d35ed497c")
add_versions("1.19.0", "3e545964ee82ee60afe4213852208e6174297b19d6b837eca3c711af34a4b107")
add_deps("cmake")

@ -0,0 +1,38 @@
package("mongo-cxx-driver")
set_homepage("https://github.com/mongodb/mongo-cxx-driver")
set_description("mongodb c++ driver")
add_urls("https://github.com/mongodb/mongo-cxx-driver/archive/r$(version).zip")
add_versions("3.6.6", "4413de483c5070b48dc5b5c8ee3e32c8e7a2b74b892fe2a55ef78fb758bc01e0")
add_deps("cmake")
add_deps("mongo-c-driver")
if is_plat("windows") then
add_deps("boost")
end
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
add_includedirs("include/bsoncxx/v_noabi")
add_includedirs("include/mongocxx/v_noabi")
on_install("windows", "macosx", "linux", function (package)
local configs = {
"-DBUILD_SHARED_AND_STATIC_LIBS=OFF",
"-DBUILD_SHARED_LIBS=ON",
"-DENABLE_TESTS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
if package:version() then
table.insert(configs, "-DBUILD_VERSION=" .. package:version())
end
io.replace("CMakeLists.txt", "add_subdirectory(examples EXCLUDE_FROM_ALL)", "", {plain = true})
io.replace("CMakeLists.txt", "add_subdirectory(benchmark EXCLUDE_FROM_ALL)", "", {plain = true})
io.replace("CMakeLists.txt", "add_subdirectory (docs)", "", {plain = true})
import("package.tools.cmake").install(package, configs, {cmake_build = true, config = (package:debug() and "Debug" or "Release")})
end)
on_test(function (package)
assert(package:has_cxxfuncs("mongocxx::instance{nullptr}",
{configs = {languages = "c++14"}, includes = "mongocxx/instance.hpp"}))
end)
Loading…
Cancel
Save