From 4840ab9beb831ec68887a5199fbb50ae6932f498 Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 22 Feb 2023 18:40:09 -0800 Subject: Checkpoint: begin work reimplementing processes It appears that you cannot spawn a wxProcess from an independent thread of execution. I imagine they're supposed to be spawned from the main thread. Fuck that, I'm going to try to use the raw WIN32 API to spawn helper processes, and do it from arbitrary thread context. * Log() now delegates to a queue which the main thread periodically drains. * Log() now writes to a file. * WhisperCPP thread is now done with std::async. * Default chars per sync is now 8 * oatpp: Promising web framework. --- GUI/Libraries/.gitignore | 2 +- GUI/Libraries/fetch.ps1 | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'GUI/Libraries') diff --git a/GUI/Libraries/.gitignore b/GUI/Libraries/.gitignore index 0e14a69..26be5d9 100644 --- a/GUI/Libraries/.gitignore +++ b/GUI/Libraries/.gitignore @@ -2,4 +2,4 @@ wx rapidyaml whisper - +oatpp diff --git a/GUI/Libraries/fetch.ps1 b/GUI/Libraries/fetch.ps1 index f13bad5..218d48b 100644 --- a/GUI/Libraries/fetch.ps1 +++ b/GUI/Libraries/fetch.ps1 @@ -12,6 +12,15 @@ $WHISPER_1_7_0_URL = "https://github.com/Const-me/Whisper/releases/download/1.7. $WHISPER_URL = $WHISPER_1_7_0_URL $WHISPER_FILE = $(Split-Path -Path $WHISPER_URL -Leaf) +$OATPP_1_3_0_URL = "https://github.com/oatpp/oatpp/archive/refs/tags/1.3.0.zip" +$OATPP_URL = $OATPP_1_3_0_URL +$OATPP_FILE = $(Split-Path -Path $OATPP_URL -Leaf) +$OATPP_VER = $OATPP_FILE -replace '\.[a-z\.]*$' +$OATPP_DIR = "oatpp-$OATPP_VER" + +$NPROC = $(Get-CimInstance Win32_Processor).NumberOfCores +echo "nproc: $NPROC" + pushd $PSScriptRoot # WX @@ -61,6 +70,28 @@ if (-Not (Test-Path whisper)) { popd > $null } +if ((Test-Path oatpp) -And ($overwrite)) { + rm -Recurse oatpp +} + +if (-Not (Test-Path oatpp)) { + mkdir oatpp + pushd oatpp > $null + Invoke-WebRequest $OATPP_URL -OutFile $OATPP_FILE + Expand-Archive $OATPP_FILE -DestinationPath . + if (Test-Path ../../GUI/GUI/oatpp/) { + rm -Recurse ../../GUI/GUI/oatpp/ + } + mkdir ../../GUI/GUI/oatpp/ + pushd $OATPP_DIR > $null + mkdir build + pushd build > $null + cmake.exe .. -DCMAKE_BUILD_TYPE=Release -DOATPP_BUILD_TESTS=OFF + cmake.exe --build . -j $NPROC --config Release + popd > $null + popd > $null +} + popd > $null # rapidyaml popd > $null # $PSScriptRoot -- cgit v1.2.3