summaryrefslogtreecommitdiff
path: root/xmake/core/base/cpu.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-04-06 22:35:05 +0800
committerruki <[email protected]>2021-04-06 22:35:05 +0800
commit5b32ed01ad055b627d098eada08c78707f4c0973 (patch)
tree06993db3eb5282e8aca391aef688f6119f94e43a /xmake/core/base/cpu.lua
parent723d07ceb2e1ca829f0fd768a01e84fdc40c6567 (diff)
add model name for windows
Diffstat (limited to 'xmake/core/base/cpu.lua')
-rw-r--r--xmake/core/base/cpu.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/core/base/cpu.lua b/xmake/core/base/cpu.lua
index 4e93feccd..224b43ba3 100644
--- a/xmake/core/base/cpu.lua
+++ b/xmake/core/base/cpu.lua
@@ -212,7 +212,8 @@ function cpu._info()
end
end
elseif os.host() == "windows" then
- cpuinfo.vendor_id = winos.registry_query("HKEY_LOCAL_MACHINE\\Hardware\\Description\\System\\CentralProcessor\\0;VendorIdentifier")
+ cpuinfo.vendor_id = winos.registry_query("HKEY_LOCAL_MACHINE\\Hardware\\Description\\System\\CentralProcessor\\0;VendorIdentifier")
+ cpuinfo.cpu_model_name = winos.registry_query("HKEY_LOCAL_MACHINE\\Hardware\\Description\\System\\CentralProcessor\\0;ProcessorNameString")
local cpu_id = winos.registry_query("HKEY_LOCAL_MACHINE\\Hardware\\Description\\System\\CentralProcessor\\0;Identifier")
if cpu_id then
local cpu_family, cpu_model = cpu_id:match("Family (%d+) Model (%d+)")
@@ -248,7 +249,7 @@ function cpu._info()
end
local ok, cpu_model_name = os.iorun("sysctl -n hw.model")
if ok and cpu_model_name then
- cpuinfo.cpu_model_name = cpu_model_name
+ cpuinfo.cpu_model_name = cpu_model_name:trim()
end
end
end