windows....sigh

This commit is contained in:
2026-03-26 12:08:55 +01:00
parent 8fe7e726a4
commit b23365b05f
15 changed files with 499 additions and 128 deletions

View File

@@ -1,16 +1,34 @@
#include "rktwebview.h"
#include <string>
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
#include "utils.h"
int main(int argc, char *argv[])
{std::string me = argv[0];
int idx = me.rfind("/");
{
std::string me = argv[0];
std::string loc = me.substr(0, idx);
std::string loc = basedir(me);
#ifdef _WIN32
std::string prg = loc + "\\rktwebview_prg.exe";
SetDllDirectoryA("C:\\Qt\\6.10.2\\msvc2022_64\\bin");
#else
std::string prg = loc + "/rktwebview_prg";
#endif
#ifdef _WIN32
{
std::string e = std::string("RKT_WEBVIEW_PRG=") + prg;
_putenv(e.c_str());
}
#else
setenv("RKT_WEBVIEW_PRG", prg.c_str(), true);
setenv("LD_LIBRARY_PATH", loc.c_str(), true);
#endif
int context = rkt_webview_new_context("", nullptr);
@@ -24,9 +42,13 @@ int main(int argc, char *argv[])
rkt_data_t *d = rkt_webview_get_event();
rkt_webview_free_data(d);
}
#ifdef _WIN32
Sleep(10);
#else
sleep(10);
#endif
rkt_webview_close(wv);
rkt_webview_cleanup();
}
}