Fix crosslang issues with tooling and update crossvm binary for webapp

This commit is contained in:
2025-09-30 22:33:29 -05:00
parent bbe0a1cefc
commit 0cd15fa351
11 changed files with 159 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ void Help(const char* filename)
}
int main(int argc, char** argv)
{
Tesses::Framework::TF_Init();
std::string name="out";
std::string info="{}";
TVMVersion version;

View File

@@ -6,6 +6,7 @@ using namespace Tesses::Framework::Streams;
int main(int argc, char** argv)
{
Tesses::Framework::TF_Init();
if(argc < 3)
{
printf("USAGE: %s <archive.crvm> <dirasroot>\n", argv[0]);

View File

@@ -6,6 +6,7 @@ int main(int argc, char** argv)
using namespace Tesses::Framework::Streams;
using namespace Tesses::Framework::Filesystem;
using namespace Tesses::CrossLang;
TF_Init();
if(argc > 1 && strcmp(argv[1],"--help"))
{
std::cout << "Run this command in directory you want to assemble (with the crossasm.json)" << std::endl;

View File

@@ -12,10 +12,12 @@ void help(char* program)
}
int main(int argc, char** argv)
{
using namespace Tesses::Framework;
using namespace Tesses::Framework::Streams;
using namespace Tesses::Framework::Filesystem;
using namespace Tesses::CrossLang;
TF_Init();
std::string file;
Tesses::Framework::Filesystem::VFSPath path = VFSPath::GetAbsoluteCurrentDirectory();

View File

@@ -265,6 +265,7 @@ void DumpFile(std::filesystem::path p)
}
int main(int argc, char** argv)
{
Tesses::Framework::TF_Init();
for(int i = 1; i < argc; i++)
{
DumpFile(argv[i]);

View File

@@ -18,6 +18,42 @@ int main(int argc, char** argv)
TStd::RegisterStd(&gc,env);
env->LoadFileWithDependencies(&gc, Tesses::Framework::Filesystem::LocalFS, Tesses::Framework::Filesystem::LocalFS->SystemToVFSPath(argv[1]));
if(env->HasVariable("WebAppMain"))
{
Args args(argc, argv);
int port = 4206;
for(auto& item : args.options)
{
if(item.first == "port")
{
port = std::stoi(item.second);
}
}
TList* args2 = TList::Create(ls);
for(auto& item : args.positional)
{
args2->Add(item);
}
auto res = env->CallFunction(ls, "WebAppMain", {args2});
auto svr2 = Tesses::CrossLang::ToHttpServer(&gc,res);
if(svr2 == nullptr) return 1;
Tesses::Framework::Http::HttpServer svr(port,svr2);
svr.StartAccepting();
TF_RunEventLoop();
TDictionary* _dict;
TClassObject* _co;
if(GetObjectHeap(res,_dict))
{
_dict->CallMethod(ls,"Close",{});
}
if(GetObjectHeap(res,_co))
{
_co->CallMethod(ls,"","Close",{});
}
TF_Quit();
}
else {
TList* args = TList::Create(ls);
for(int arg=1;arg<argc;arg++)
args->Add(std::string(argv[arg]));
@@ -26,5 +62,6 @@ int main(int argc, char** argv)
int64_t iresult;
if(GetObject(res,iresult))
return (int)iresult;
}
return 0;
}

View File

@@ -11,6 +11,7 @@ int main(int argc, char** argv)
using namespace Tesses::Framework::Streams;
using namespace Tesses::Framework::Filesystem;
using namespace Tesses::CrossLang;
TF_Init();
if(argc < 3)
{

View File

@@ -8,6 +8,7 @@
#include <fstream>
int main(int argc,char** argv)
{
Tesses::Framework::TF_Init();
std::string p = argv[0];
auto emptyThumb =Tesses::Framework::Platform::Environment::GetRealExecutablePath(p).GetParent().GetParent() / "share" / "icons" / "crosslang.png";