diff options
| author | ruki <[email protected]> | 2020-10-14 23:26:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-14 23:26:51 +0800 |
| commit | bc3367481485ab9780452e8980fe3aa8162e621f (patch) | |
| tree | 94bf06486692c0f6045c251e44583bd48dc1ee73 | |
| parent | 7104509afd465ee37e5d76d059aa1504da6a6a80 (diff) | |
add has_types for package
| -rw-r--r-- | xmake/core/package/package.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index dbf94f490..ba66ecdd5 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1045,6 +1045,40 @@ function _instance:has_cxxfuncs(funcs, opt) return sandbox_module.import("lib.detect.has_cxxfuncs", {anonymous = true})(funcs, opt) end +-- has the given c types? +-- +-- @param types the types +-- @param opt the argument options, e.g. { defines = ""} +-- +-- @return true or false +-- +function _instance:has_ctypes(types, opt) + if self:plat() ~= config.get("plat") then + -- TODO + return true + end + opt = opt or {} + opt.configs = table.join(self:fetchdeps(), opt.configs) + return sandbox_module.import("lib.detect.has_ctypes", {anonymous = true})(types, opt) +end + +-- has the given c++ types? +-- +-- @param types the types +-- @param opt the argument options, e.g. { defines = ""} +-- +-- @return true or false +-- +function _instance:has_cxxtypes(types, opt) + if self:plat() ~= config.get("plat") then + -- TODO + return true + end + opt = opt or {} + opt.configs = table.join(self:fetchdeps(), opt.configs) + return sandbox_module.import("lib.detect.has_cxxtypes", {anonymous = true})(types, opt) +end + -- has the given c includes? -- -- @param includes the includes |
