summaryrefslogtreecommitdiffstats
path: root/platform/macos
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos')
-rw-r--r--platform/macos/SCsub4
-rw-r--r--platform/macos/os_macos.h2
-rw-r--r--platform/macos/os_macos.mm9
3 files changed, 14 insertions, 1 deletions
diff --git a/platform/macos/SCsub b/platform/macos/SCsub
index 3924e79fb6..598444ae24 100644
--- a/platform/macos/SCsub
+++ b/platform/macos/SCsub
@@ -27,7 +27,9 @@ def generate_bundle(target, source, env):
target_bin = lipo(bin_dir + "/" + prefix, env.extra_suffix + env.module_version_string)
# Assemble .app bundle and update version info.
- app_dir = Dir("#bin/" + (prefix + env.extra_suffix + env.module_version_string).replace(".", "_") + ".app").abspath
+ app_dir = Dir(
+ "#bin/" + (prefix + env.extra_suffix + env.module_version_string).replace(".", "_") + ".app"
+ ).abspath
templ = Dir("#misc/dist/macos_tools.app").abspath
if os.path.exists(app_dir):
shutil.rmtree(app_dir)
diff --git a/platform/macos/os_macos.h b/platform/macos/os_macos.h
index 303fc112bf..4fb4507837 100644
--- a/platform/macos/os_macos.h
+++ b/platform/macos/os_macos.h
@@ -114,6 +114,8 @@ public:
virtual String get_unique_id() const override;
virtual String get_processor_name() const override;
+ virtual String get_model_name() const override;
+
virtual bool is_sandboxed() const override;
virtual Vector<String> get_granted_permissions() const override;
virtual void revoke_granted_permissions() override;
diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm
index d9086b8c38..08ff391aab 100644
--- a/platform/macos/os_macos.mm
+++ b/platform/macos/os_macos.mm
@@ -67,6 +67,15 @@ void OS_MacOS::initialize() {
initialize_core();
}
+String OS_MacOS::get_model_name() const {
+ char buffer[256];
+ size_t buffer_len = 256;
+ if (sysctlbyname("hw.model", &buffer, &buffer_len, nullptr, 0) == 0 && buffer_len != 0) {
+ return String::utf8(buffer, buffer_len);
+ }
+ return OS_Unix::get_model_name();
+}
+
String OS_MacOS::get_processor_name() const {
char buffer[256];
size_t buffer_len = 256;