summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-03-02 00:40:36 +0800
committerruki <[email protected]>2024-03-02 00:40:36 +0800
commitb3881c9439676dd72c88b62171ce2da7575e17f9 (patch)
tree5d233aa7cb7b9a236f2358adb452951bbc2a3f9a
parent6287c83ac103dda3b3b977f18dc21ac382580033 (diff)
add check_sizeof in package
-rw-r--r--xmake/core/package/package.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 9ef2abfe6..836bb22a5 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