start out updating macos
This commit is contained in:
parent
ff3d9bcce8
commit
5f2ecf8cae
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,6 +5,7 @@
|
|||
.vs/
|
||||
.vscode/
|
||||
.xmake/
|
||||
.DS_Store
|
||||
|
||||
bin/
|
||||
build/
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
systemdLibs
|
||||
sdbus-cpp
|
||||
valgrind
|
||||
linuxKernel.packages.linux_zen.perf.out
|
||||
]);
|
||||
|
||||
darwinPkgs = nixpkgs.lib.optionals stdenv.isDarwin (with pkgs.pkgsStatic.darwin.apple_sdk.frameworks; [
|
||||
|
@ -145,8 +146,6 @@
|
|||
nvfetcher
|
||||
pkg-config
|
||||
unzip
|
||||
nixvim.packages.${system}.default
|
||||
linuxKernel.packages.linux_zen.perf.out
|
||||
|
||||
(writeScriptBin "build" "meson compile -C build")
|
||||
(writeScriptBin "clean" "meson setup build --wipe")
|
||||
|
|
|
@ -2,7 +2,6 @@ project(
|
|||
'draconis++', 'cpp',
|
||||
version: '0.1.0',
|
||||
default_options: [
|
||||
'cpp_std=c++26',
|
||||
'default_library=static',
|
||||
'warning_level=everything',
|
||||
'buildtype=debugoptimized'
|
||||
|
@ -16,6 +15,7 @@ if host_machine.system() == 'darwin'
|
|||
objcpp = meson.get_compiler('objcpp')
|
||||
add_project_arguments(
|
||||
objcpp.get_supported_arguments([
|
||||
'-std=c++2b',
|
||||
'-Wno-c++20-compat',
|
||||
'-Wno-c++20-extensions',
|
||||
'-Wno-c++98-compat',
|
||||
|
@ -33,6 +33,7 @@ if host_machine.system() == 'darwin'
|
|||
endif
|
||||
|
||||
common_cpp_args = [
|
||||
'-std=c++26',
|
||||
'-Wno-c++20-compat',
|
||||
'-Wno-c++20-extensions',
|
||||
'-Wno-c++98-compat',
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifdef __APPLE__
|
||||
|
||||
#include <map>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "macos/bridge.h"
|
||||
#include "os.h"
|
||||
|
@ -25,4 +27,29 @@ fn GetOSVersion() -> string { return GetMacOSVersion(); }
|
|||
|
||||
fn GetDesktopEnvironment() -> string { return "Aqua"; }
|
||||
|
||||
fn GetKernelVersion() -> string {
|
||||
struct utsname uts;
|
||||
|
||||
if (uname(&uts) == -1) {
|
||||
ERROR_LOG("uname() failed: {}", std::strerror(errno));
|
||||
return "";
|
||||
}
|
||||
|
||||
return static_cast<const char*>(uts.release);
|
||||
}
|
||||
|
||||
fn GetHost() -> string {
|
||||
std::array<char, 256> hwModel;
|
||||
size_t hwModelLen = sizeof(hwModel);
|
||||
|
||||
sysctlbyname("hw.model", hwModel.data(), &hwModelLen, nullptr, 0);
|
||||
|
||||
// shamelessly stolen from https://github.com/fastfetch-cli/fastfetch/blob/dev/src/detection/host/host_mac.c
|
||||
std::map<string, string> modelNameByHwModel = {
|
||||
{ "Mac14,2", "MacBook Air (M2, 2022)" }
|
||||
};
|
||||
|
||||
return modelNameByHwModel[hwModel.data()];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue