package An official xmake package repository
https://xrepo.xmake.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.4 KiB
31 lines
1.4 KiB
package("flatbuffers") |
|
|
|
set_homepage("http://google.github.io/flatbuffers/") |
|
set_description("FlatBuffers is a cross platform serialization library architected for maximum memory efficiency.") |
|
|
|
add_urls("https://github.com/google/flatbuffers/archive/v$(version).zip") |
|
add_versions("1.12.0", "4b8b21adbfe8a74b90604161afcf87c125a26b86c99327e7a04525080606536c") |
|
|
|
add_deps("cmake") |
|
on_install("windows", "linux", "macosx", "mingw", "android", "iphoneos", function(package) |
|
local configs = {"-DFLATBUFFERS_BUILD_TESTS=OFF"} |
|
if is_plat("android", "iphoneos") then |
|
table.insert(configs, "-DFLATBUFFERS_BUILD_FLATC=OFF") |
|
table.insert(configs, "-DFLATBUFFERS_BUILD_FLATHASH=OFF") |
|
end |
|
import("package.tools.cmake").install(package, configs) |
|
package:addenv("PATH", "bin") |
|
end) |
|
|
|
on_test(function(package) |
|
if is_plat("windows", "linux", "macosx", "mingw@windows") then |
|
os.vrun("flatc --version") |
|
end |
|
assert(package:check_cxxsnippets({test = [[ |
|
void test() { |
|
flatbuffers::FlatBufferBuilder builder; |
|
builder.CreateString("MyMonster"); |
|
flatbuffers::DetachedBuffer dtbuilder = builder.Release(); |
|
} |
|
]]}, {configs = {languages = "c++14"}, includes = "flatbuffers/flatbuffers.h"})) |
|
end)
|
|
|