Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions packages/n/node_crunch2/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,20 @@ package("node_crunch2")
int value = *result;
}
}
]]}, {configs = {languages = "c++20"}}),
"package(node_crunch2) requires a compiler supporting C++20 with <expected> header.")
]]}, {configs = {languages = "c++23"}}),
"package(node_crunch2) requires a compiler supporting C++23 with <expected> header.")
assert(package:check_cxxsnippets({test = [[
#include <vector>
#include <cstdint>
struct NCCompressedMessage {
std::vector<uint8_t> data = {};
};
void test() {
std::vector<uint8_t> compressed_data;
auto msg = NCCompressedMessage(compressed_data);
}
]]}, {configs = {languages = "c++23"}}),
"package(node_crunch2) requires a compiler supporting parenthesized aggregate initialization.")
end)
end

Expand All @@ -34,10 +46,6 @@ package("node_crunch2")
end)

on_test(function (package)
local package_std = "c++20"
if package:is_plat("windows") then
package_std = "c++23"
end
assert(package:check_cxxsnippets({
test = [[
using namespace NodeCrunch2;
Expand All @@ -50,5 +58,5 @@ package("node_crunch2")
NCConfiguration config = NCConfiguration(key1);
}
]]
}, {configs = {languages = package_std}, includes = {"nc_message.hpp", "nc_config.hpp"}}))
}, {configs = {languages = "c++23"}, includes = {"nc_message.hpp", "nc_config.hpp"}}))
end)
Loading