summaryrefslogtreecommitdiff
path: root/xmake/core/base/cpu.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-04-06 22:32:41 +0800
committerruki <[email protected]>2021-04-06 22:32:41 +0800
commit723d07ceb2e1ca829f0fd768a01e84fdc40c6567 (patch)
tree2613625053d34593d745f8056c97ebd49bbb7589 /xmake/core/base/cpu.lua
parent815553f6850001c1f5eb23f64453a5efd9bf517d (diff)
add model name for bsd
Diffstat (limited to 'xmake/core/base/cpu.lua')
-rw-r--r--xmake/core/base/cpu.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/core/base/cpu.lua b/xmake/core/base/cpu.lua
index fe9bf9a70..4e93feccd 100644
--- a/xmake/core/base/cpu.lua
+++ b/xmake/core/base/cpu.lua
@@ -246,7 +246,10 @@ function cpu._info()
if cpuinfo.cpu_features then
cpuinfo.cpu_features = cpuinfo.cpu_features:lower():gsub(",", " ")
end
- cpuinfo.model_name = os.iorun("sysctl -n hw.model")
+ 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
+ end
end
end
cpu._CPUINFO = cpuinfo