Sol2 Disable test if includes_lua is set to false (#225)

pull/226/head
Jérôme Leclercq 4 years ago committed by GitHub
parent 91e21d3b7f
commit 30f9066412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      packages/s/sol2/xmake.lua

@ -24,15 +24,17 @@ package("sol2")
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <sol/sol.hpp>
#include <cassert>
void test() {
sol::state lua;
int x = 0;
lua.set_function("beep", [&x]{ ++x; });
lua.script("beep()");
assert(x == 1);
}
]]}, {configs = {languages = "c++17"}}))
if package:config("includes_lua") then
assert(package:check_cxxsnippets({test = [[
#include <sol/sol.hpp>
#include <cassert>
void test() {
sol::state lua;
int x = 0;
lua.set_function("beep", [&x]{ ++x; });
lua.script("beep()");
assert(x == 1);
}
]]}, {configs = {languages = "c++17"}}))
end
end)

Loading…
Cancel
Save