[rsm-binary-io] Add package (#2151)

* [rsm-binary-io] Add package

* [rsm-binary-io] License

* [rsm-binary-io] Add git url

* [rsm-binary-io] Support `shared`

* [rsm-binary-io] Export classes
pull/2153/head
Qudix 1 year ago committed by GitHub
parent 85ef8ef44e
commit 7b1ef43416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 35
      packages/r/rsm-binary-io/xmake.lua

@ -0,0 +1,35 @@
package("rsm-binary-io")
set_homepage("https://github.com/Ryan-rsm-McKenzie/binary_io")
set_description("A binary i/o library for C++, without the agonizing pain")
set_license("MIT")
add_urls("https://github.com/Ryan-rsm-McKenzie/binary_io/archive/refs/tags/$(version).tar.gz",
"https://github.com/Ryan-rsm-McKenzie/binary_io.git")
add_versions("2.0.5", "4cc904ef02f77e04756cbdf01372629b0f04d859f06ee088d854468abdd4b840")
on_install(function (package)
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
set_languages("c++20")
target("rsm-binary-io")
set_kind("$(kind)")
add_files("src/**.cpp")
add_includedirs("include/")
add_headerfiles("include/(**.hpp)")
if is_plat("windows") and is_kind("shared") then
add_rules("utils.symbols.export_all", {export_classes = true})
end
]])
local configs = {}
configs.kind = package:config("shared") and "shared" or "static"
import("package.tools.xmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test(int argc, char** argv) {
binary_io::span_istream s;
assert(s.tell() == 0);
}
]]}, {configs = {languages = "c++20"}, includes = {"binary_io/binary_io.hpp", "assert.h"}}))
end)
Loading…
Cancel
Save