diff options
| -rw-r--r-- | xmake/core/project/package.lua | 12 | ||||
| -rw-r--r-- | xmake/core/project/project.lua | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/xmake/core/project/package.lua b/xmake/core/project/package.lua index a716ae9e6..0e0b4f964 100644 --- a/xmake/core/project/package.lua +++ b/xmake/core/project/package.lua @@ -62,11 +62,21 @@ function _instance:get(infoname) return self._INFO[infoname] end --- get the require name +-- get the package name (with alias name) function _instance:name() return self._NAME end +-- get raw package name +function _instance:package_name() + local packagename = self._PACKAGE_NAME + if not packagename then + packagename = self:requirestr():split("%s")[1] + self._PACKAGE_NAME = packagename + end + return packagename +end + -- get the package version function _instance:version() diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index bb1540106..8e53dbc4e 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -485,7 +485,7 @@ function project._load_requires() for _, requirestr in ipairs(table.wrap(requires_str)) do -- get the package name - local packagename = requirestr:split('%s')[1] + local packagename = requirestr:split("%s")[1] -- get alias local alias = nil |
