Merge pull request #34 from fasiondog/master

update for fmt
pull/37/head
ruki 5 years ago committed by GitHub
commit abfae2efe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      packages/f/fmt/xmake.lua

@ -7,18 +7,33 @@ 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_configs("header_only", {description = "Use header only", default = true, type = "boolean"})
on_install("windows", function (package)
os.cp("include/fmt", package:installdir("include"))
on_load(function (package)
if package:config("header_only") then
package:add("defines", "FMT_HEADER_ONLY=1")
else
package:add("deps", "cmake")
end
if package:config("shared") then
package:add("defines", "FMT_EXPORT")
end
end)
on_install("linux", "macosx", function (package)
import("package.tools.cmake").install(package)
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"))
table.insert(configs, "-DFMT_TEST=OFF")
table.insert(configs, "-DFMT_DOC=OFF")
table.insert(configs, "-DFMT_FUZZ=OFF")
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <fmt/format.h>

Loading…
Cancel
Save