|
@@ -10,6 +10,7 @@ package("reflect-cpp")
|
|
|
add_versions("v0.11.1", "e45f112fb3f14507a4aa53b99ae2d4ab6a4e7b2d5f04dd06fec00bf7faa7bbdc")
|
|
|
add_versions("v0.10.0", "d2c8876d993ddc8c57c5804e767786bdb46a2bdf1a6cd81f4b14f57b1552dfd7")
|
|
|
|
|
|
+ add_patches("0.11.1", "patches/0.11.1/cmake.patch", "a43ae2c6de455054ab860adfb309da7bd376c31c493c8bab0ebe07aae0805205")
|
|
|
add_patches("0.10.0", "patches/0.10.0/cmake.patch", "b8929c0a13bd4045cbdeea0127e08a784e2dc8c43209ca9f056fff4a3ab5c4d3")
|
|
|
|
|
|
add_configs("bson", {description = "Enable Bson Support.", default = false, type = "boolean", readonly = true})
|
|
@@ -25,13 +26,8 @@ package("reflect-cpp")
|
|
|
|
|
|
on_check(function (package)
|
|
|
if package:is_plat("windows") then
|
|
|
- import("core.tool.toolchain")
|
|
|
-
|
|
|
- local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()})
|
|
|
- if msvc then
|
|
|
- local vs = msvc:config("vs")
|
|
|
- assert(vs and tonumber(vs) >= 2022, "package(reflect-cpp): need vs >= 2022")
|
|
|
- end
|
|
|
+ local vs = package:toolchain("msvc"):config("vs")
|
|
|
+ assert(vs and tonumber(vs) >= 2022, "package(reflect-cpp): need vs >= 2022")
|
|
|
else
|
|
|
assert(package:check_cxxsnippets({test = [[
|
|
|
#include <ranges>
|
|
@@ -74,10 +70,22 @@ package("reflect-cpp")
|
|
|
if package:config("yaml") then
|
|
|
package:add("deps", "yaml-cpp")
|
|
|
end
|
|
|
+
|
|
|
+ local version = package:version()
|
|
|
+ if version and version:ge("0.11.1") then
|
|
|
+ package:add("deps", "ctre")
|
|
|
+ package:add("defines", "REFLECTCPP_NO_BUNDLED_DEPENDENCIES")
|
|
|
+ end
|
|
|
end)
|
|
|
|
|
|
on_install(function (package)
|
|
|
- import("package.tools.cmake").install(package)
|
|
|
+ local version = package:version()
|
|
|
+ if version and version:ge("0.11.1") and package:is_plat("wasm") then
|
|
|
+ io.replace("CMakeLists.txt", "find_package(ctre CONFIG REQUIRED)", "", {plain = true})
|
|
|
+ io.replace("CMakeLists.txt", "find_package(yyjson CONFIG REQUIRED)", "", {plain = true})
|
|
|
+ io.replace("CMakeLists.txt", "target_link_libraries(reflectcpp INTERFACE yyjson::yyjson)", "", {plain = true})
|
|
|
+ end
|
|
|
+ import("package.tools.cmake").install(package, {"-DREFLECTCPP_USE_BUNDLED_DEPENDENCIES=OFF"})
|
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|