windows....sigh
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user