summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-03 00:41:08 +0800
committerruki <[email protected]>2023-11-03 00:41:08 +0800
commitc63207ba0564b1ad87b7d31df738da26c421e796 (patch)
tree2aef463a92deff57a071de5bf4b3a12c3633ebe6 /xmake/core/project/target.lua
parentd92d8ad1fda4d9605d08ae4c44271d9273642a93 (diff)
add check_sizeof for target
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 17a7dad9c..32fc41596 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -2604,6 +2604,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