improve outcome (#1658)

* improve outcome

* fix test on clang
pull/1659/head
Arthur Laurent 2 years ago committed by GitHub
parent d672209cf4
commit f17610c61b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      packages/o/outcome/xmake.lua

@ -1,4 +1,5 @@
package("outcome") package("outcome")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/ned14/outcome") set_homepage("https://github.com/ned14/outcome")
set_description("Provides very lightweight outcome<T> and result<T> (non-Boost edition)") set_description("Provides very lightweight outcome<T> and result<T> (non-Boost edition)")
set_license("Apache-2.0") set_license("Apache-2.0")
@ -18,15 +19,24 @@ package("outcome")
add_versions(version, commit) add_versions(version, commit)
end end
add_deps("cmake")
add_deps("quickcpplib") add_deps("quickcpplib")
on_install(function (package) on_install(function (package)
local configs = {"-DOUTCOME_ENABLE_DEPENDENCY_SMOKE_TEST=OFF", "-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON", "-DPROJECT_IS_DEPENDENCY=ON"} io.writefile("xmake.lua", [[
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) add_requires("quickcpplib")
import("package.tools.cmake").install(package, configs) target("outcome")
set_kind("headeronly")
add_packages("quickcpplib")
add_headerfiles("include/(outcome/**.hpp)")
add_headerfiles("include/(outcome/**.ixx)")
add_headerfiles("include/(outcome/**.ipp)")
add_headerfiles("include/(outcome/**.h)")
add_includedirs("include")
]])
import("package.tools.xmake").install(package)
end) end)
on_test(function (package) on_test(function (package)
local cxxflags = package:has_tool("cxx", "clang", "clangxx") and {"-fsized-deallocation"} or {}
assert(package:check_cxxsnippets({test = [[ assert(package:check_cxxsnippets({test = [[
#include <outcome/outcome.hpp> #include <outcome/outcome.hpp>
void test () { void test () {
@ -36,5 +46,5 @@ package("outcome")
(void) f; (void) f;
(void) m; (void) m;
} }
]]}, {configs = {languages = "c++17"}})) ]]}, {configs = {languages = "c++17", cxxflags = cxxflags}}))
end) end)

Loading…
Cancel
Save