forked from qt-creator/qt-creator
Lua: Add HostOsInfo.architecture
Change-Id: I6acbb9d960cc070335454d0d87674a782a7c930e Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -92,6 +92,24 @@ void addUtilsModule()
|
|||||||
else
|
else
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}());
|
}());
|
||||||
|
hostOsInfoType["architecture"] = sol::var([]() {
|
||||||
|
switch (HostOsInfo::hostArchitecture()) {
|
||||||
|
case OsArchUnknown:
|
||||||
|
return "unknown";
|
||||||
|
case OsArchX86:
|
||||||
|
return "x86";
|
||||||
|
case OsArchAMD64:
|
||||||
|
return "x86_64";
|
||||||
|
case OsArchItanium:
|
||||||
|
return "itanium";
|
||||||
|
case OsArchArm:
|
||||||
|
return "arm";
|
||||||
|
case OsArchArm64:
|
||||||
|
return "arm64";
|
||||||
|
default:
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
|
||||||
sol::usertype<FilePath> filePathType = utils.new_usertype<FilePath>(
|
sol::usertype<FilePath> filePathType = utils.new_usertype<FilePath>(
|
||||||
"FilePath",
|
"FilePath",
|
||||||
|
|||||||
@@ -81,4 +81,9 @@ function utils.FilePath:completeSuffix() end
|
|||||||
---Returns whether the path is absolute
|
---Returns whether the path is absolute
|
||||||
---@return boolean
|
---@return boolean
|
||||||
function utils.FilePath:isAbsolutePath() end
|
function utils.FilePath:isAbsolutePath() end
|
||||||
|
|
||||||
|
---@class HostOsInfo
|
||||||
|
---@field os "mac"|"windows"|"linux" The current host operating system
|
||||||
|
---@field architecture "unknown"|"x86"|"x86_64"|"itanium"|"arm"|"arm64" The current host architecture
|
||||||
|
utils.HostOsInfo = {}
|
||||||
return utils
|
return utils
|
||||||
|
|||||||
Reference in New Issue
Block a user