rttr: add latest version (#4743)

pull/4745/head
star9029 4 months ago committed by GitHub
parent b87af4f41e
commit 05e5a1ecc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 49
      packages/r/rttr/xmake.lua

@ -2,41 +2,40 @@ package("rttr")
set_homepage("https://www.rttr.org") set_homepage("https://www.rttr.org")
set_description("rttr: An open source library, which adds reflection to C++.") set_description("rttr: An open source library, which adds reflection to C++.")
set_license("MIT") set_license("MIT")
add_urls("https://github.com/rttrorg/rttr/archive/7edbd580cfad509a3253c733e70144e36f02ecd4.tar.gz",
"https://github.com/rttrorg/rttr.git")
-- 2021.08.11
add_versions("0.9.7", "bba4b6fac2349fa6badc701aad5e7afb87504a7089a867b1a7cbed08fb2f3a90")
add_configs("rtti", {description = "Build with RTTI support.", default = true, type = "boolean"})
if is_plat("macosx") then if is_plat("macosx") then
add_extsources("brew::rttr") add_extsources("brew::rttr")
end end
add_urls("https://www.rttr.org/releases/rttr-$(version)-src.tar.gz",
"https://github.com/rttrorg/rttr/releases/download/v$(version)/rttr-$(version)-src.tar.gz",
"https://github.com/rttrorg/rttr.git")
add_versions("0.9.6", "f62caee43016489320f8a69145c9208cddd72e451ea95618bc26a49a4cd6c990")
add_versions("0.9.5", "caa8d404840b0e156f869a947e475b09f7b602ab53c290271f40ce028c8d7d91")
add_deps("cmake") add_deps("cmake")
on_install(function (package) on_install(function (package)
local configs = {} io.replace("CMake/utility.cmake", "/WX", "", {plain = true})
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) io.replace("CMake/utility.cmake", "-Werror", "", {plain = true})
table.insert(configs, "-DBUILD_EXAMPLES=OFF")
table.insert(configs, "-DBUILD_DOCUMENTATION=OFF") local configs = {
table.insert(configs, "-DBUILD_UNIT_TESTS=OFF") -- rttr has problem building unit tests on macosx. "-DBUILD_EXAMPLES=OFF",
-- rttr use BUILD_RTTR_DYNAMIC and BUILD_STATIC options to control whether to build dynamic or static libraries. "-DBUILD_DOCUMENTATION=OFF",
table.insert(configs, "-DBUILD_RTTR_DYNAMIC=" .. (package:config("shared") and "ON" or "OFF")) "-DBUILD_UNIT_TESTS=OFF",
table.insert(configs, "-DBUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON")) "-DBUILD_DOCUMENTATION=OFF",
local cxflags "-DBUILD_PACKAGE=OFF",
if package:has_tool("cxx", "gcc", "gxx", "clang", "clangxx") then }
if not package:is_plat("windows") then local shared = package:config("shared")
-- Passing this flag to clang-cl may cause errors. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
-- gcc does not seem to support -Wno-error options. table.insert(configs, "-DBUILD_RTTR_DYNAMIC=" .. (shared and "ON" or "OFF"))
cxflags = "-Wno-implicit-float-conversion" table.insert(configs, "-DBUILD_STATIC=" .. (shared and "OFF" or "ON"))
end table.insert(configs, "-DBUILD_WITH_RTTI=" .. (package:config("rtti") and "ON" or "OFF"))
end import("package.tools.cmake").install(package, configs)
if package:is_plat("windows") and package:config("shared") then if package:is_plat("windows") and shared then
package:add("defines", "RTTR_DLL") package:add("defines", "RTTR_DLL")
end end
import("package.tools.cmake").install(package, configs, {cxflags = cxflags})
end) end)
on_test(function (package) on_test(function (package)

Loading…
Cancel
Save