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

Loading…
Cancel
Save