Compare commits
2 commits
ece34c270c
...
a06b940892
Author | SHA1 | Date | |
---|---|---|---|
a06b940892 | |||
57da656da5 |
4 changed files with 21 additions and 11 deletions
18
meson.build
18
meson.build
|
@ -5,7 +5,7 @@ project(
|
||||||
default_options: [
|
default_options: [
|
||||||
'default_library=static',
|
'default_library=static',
|
||||||
'warning_level=everything',
|
'warning_level=everything',
|
||||||
'buildtype=release',
|
'buildtype=debugoptimized',
|
||||||
'cpp_args=-fvisibility=hidden',
|
'cpp_args=-fvisibility=hidden',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -128,17 +128,23 @@ endif
|
||||||
|
|
||||||
deps += ftxui_dep
|
deps += ftxui_dep
|
||||||
|
|
||||||
reflectcpp_proj = cmake.subproject('reflectcpp')
|
cmake_opts = cmake.subproject_options()
|
||||||
reflectcpp_dep = reflectcpp_proj.dependency('reflectcpp')
|
|
||||||
|
cmake_opts.add_cmake_defines({
|
||||||
|
'CMAKE_CXX_FLAGS': '-Wno-everything',
|
||||||
|
})
|
||||||
|
|
||||||
|
cmake_opts.append_compile_args('cpp', '-Wno-everything')
|
||||||
|
|
||||||
|
reflectcpp_proj = cmake.subproject('reflectcpp', options: cmake_opts)
|
||||||
|
reflectcpp_dep = reflectcpp_proj.dependency('reflectcpp', include_type: 'system')
|
||||||
deps += reflectcpp_dep
|
deps += reflectcpp_dep
|
||||||
|
|
||||||
objc_args = []
|
objc_args = []
|
||||||
link_args = []
|
link_args = ['-static-libgcc', '-static-libstdc++', '-static']
|
||||||
|
|
||||||
if host_machine.system() == 'darwin'
|
if host_machine.system() == 'darwin'
|
||||||
objc_args += ['-fobjc-arc']
|
objc_args += ['-fobjc-arc']
|
||||||
elif host_machine.system() == 'linux'
|
|
||||||
link_args += ['-static-libgcc', '-static-libstdc++']
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
executable(
|
executable(
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <wincrypt.h>
|
||||||
#include <winrt/Windows.Foundation.h>
|
#include <winrt/Windows.Foundation.h>
|
||||||
#include <winrt/Windows.Media.Control.h>
|
#include <winrt/Windows.Media.Control.h>
|
||||||
#include <winrt/base.h>
|
#include <winrt/base.h>
|
||||||
|
@ -39,6 +41,7 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(key);
|
RegCloseKey(key);
|
||||||
|
|
||||||
// Remove null terminator if present
|
// Remove null terminator if present
|
||||||
if (!value.empty() && value.back() == '\0')
|
if (!value.empty() && value.back() == '\0')
|
||||||
value.pop_back();
|
value.pop_back();
|
||||||
|
@ -50,6 +53,7 @@ namespace {
|
||||||
fn GetRunningProcesses() -> std::vector<string> {
|
fn GetRunningProcesses() -> std::vector<string> {
|
||||||
std::vector<string> processes;
|
std::vector<string> processes;
|
||||||
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||||
|
|
||||||
if (hSnapshot == INVALID_HANDLE_VALUE)
|
if (hSnapshot == INVALID_HANDLE_VALUE)
|
||||||
return processes;
|
return processes;
|
||||||
|
|
||||||
|
@ -61,7 +65,7 @@ namespace {
|
||||||
return processes;
|
return processes;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (Process32Next(hSnapshot, &pe32)) { processes.emplace_back(pe32.szExeFile); }
|
while (Process32Next(hSnapshot, &pe32)) processes.emplace_back(pe32.szExeFile);
|
||||||
|
|
||||||
CloseHandle(hSnapshot);
|
CloseHandle(hSnapshot);
|
||||||
return processes;
|
return processes;
|
||||||
|
@ -158,8 +162,10 @@ fn GetKernelVersion() -> string {
|
||||||
if (ntdllHandle) {
|
if (ntdllHandle) {
|
||||||
auto rtlGetVersion = std::bit_cast<RtlGetVersionPtr>(GetProcAddress(ntdllHandle, "RtlGetVersion"));
|
auto rtlGetVersion = std::bit_cast<RtlGetVersionPtr>(GetProcAddress(ntdllHandle, "RtlGetVersion"));
|
||||||
if (rtlGetVersion) {
|
if (rtlGetVersion) {
|
||||||
RTL_OSVERSIONINFOW osInfo = {};
|
RTL_OSVERSIONINFOW osInfo = {};
|
||||||
|
|
||||||
osInfo.dwOSVersionInfoSize = sizeof(osInfo);
|
osInfo.dwOSVersionInfoSize = sizeof(osInfo);
|
||||||
|
|
||||||
if (rtlGetVersion(&osInfo) == 0)
|
if (rtlGetVersion(&osInfo) == 0)
|
||||||
versionStream << osInfo.dwMajorVersion << "." << osInfo.dwMinorVersion << "." << osInfo.dwBuildNumber << "."
|
versionStream << osInfo.dwMajorVersion << "." << osInfo.dwMinorVersion << "." << osInfo.dwBuildNumber << "."
|
||||||
<< osInfo.dwPlatformId;
|
<< osInfo.dwPlatformId;
|
||||||
|
@ -225,6 +231,7 @@ fn GetDesktopEnvironment() -> optional<string> {
|
||||||
|
|
||||||
if (build >= 9600)
|
if (build >= 9600)
|
||||||
return "Metro (Windows 8.1)";
|
return "Metro (Windows 8.1)";
|
||||||
|
|
||||||
return "Metro (Windows 8)";
|
return "Metro (Windows 8)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 48ea775531523ac290abec91107c628f00156543
|
|
|
@ -1,2 +0,0 @@
|
||||||
[wrap-redirect]
|
|
||||||
filename = SQLiteCpp-3.3.2/subprojects/sqlite3.wrap
|
|
Loading…
Add table
Reference in a new issue