|
|
|
@ -7,18 +7,30 @@ package("fmt") |
|
|
|
|
add_versions("6.0.0", "b4a16b38fa171f15dbfb958b02da9bbef2c482debadf64ac81ec61b5ac422440") |
|
|
|
|
add_versions("5.3.0", "4c0741e10183f75d7d6f730b8708a99b329b2f942dad5a9da3385ab92bb4a15c") |
|
|
|
|
|
|
|
|
|
if is_plat("linux", "macosx") then |
|
|
|
|
add_deps("cmake") |
|
|
|
|
end |
|
|
|
|
add_deps("cmake") |
|
|
|
|
|
|
|
|
|
on_install("windows", function (package) |
|
|
|
|
os.cp("include/fmt", package:installdir("include")) |
|
|
|
|
end) |
|
|
|
|
add_configs("header_only", {description = "Use header only", default = true, type = "boolean"}) |
|
|
|
|
|
|
|
|
|
on_install("linux", "macosx", function (package) |
|
|
|
|
on_load(function (package) |
|
|
|
|
if package:config("header_only") then |
|
|
|
|
package:add("defines", "FMT_HEADER_ONLY=1") |
|
|
|
|
end |
|
|
|
|
if package:config("shared") then |
|
|
|
|
package:add("defines", "FMT_EXPORT") |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_install("windows", function (package) |
|
|
|
|
if package:config("header_only") then |
|
|
|
|
os.cp("include/fmt", package:installdir("include")) |
|
|
|
|
return |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
local configs = {} |
|
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
|
import("package.tools.cmake").install(package) |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
on_test(function (package) |
|
|
|
|
assert(package:check_cxxsnippets({test = [[ |
|
|
|
|
#include <fmt/format.h> |
|
|
|
|