From b3881c9439676dd72c88b62171ce2da7575e17f9 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 2 Mar 2024 00:40:36 +0800 Subject: [PATCH] add check_sizeof in package --- xmake/core/package/package.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 9ef2abfe6a7..836bb22a55f 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -2438,6 +2438,19 @@ function _instance:has_features(features, opt) return sandbox_module.import("core.tool.compiler", {anonymous = true}).has_features(features, opt) end +-- check the size of type +-- +-- @param typename the typename +-- @param opt the argument options, e.g. {includes = "xxx.h", configs = {defines = ""}} +-- +-- @return the type size +-- +function _instance:check_sizeof(typename, opt) + opt = opt or {} + opt.target = self + return sandbox_module.import("lib.detect.check_sizeof", {anonymous = true})(typename, opt) +end + -- check the given c snippets? -- -- @param snippets the snippets