Skip to content

Commit

Permalink
remind me to never use windows again
Browse files Browse the repository at this point in the history
  • Loading branch information
meepen committed Jul 2, 2021
1 parent 1a90281 commit 00a45f2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
36 changes: 22 additions & 14 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ newoption {
description = "Enables JIT state runtime (if available)"
}

local protobuf_include = os.findheader "google/protobuf/port_def.inc"

os.execute "protoc --proto_path=src/vm/proto/src --cpp_out=src/vm/proto src/vm/proto/src/bytecode.proto"

local libs = {
lexer = {
includes = {
Expand Down Expand Up @@ -48,7 +52,8 @@ local libs = {
includes = {
dirs = {
"src",
"src/vm"
"src/vm",
protobuf_include
},
files = {
"src/vm/**.hpp"
Expand All @@ -57,8 +62,13 @@ local libs = {
links = {
"asmjit",
"parser",
"protobuf",
"pthread",
["system:not windows"] = {
"protobuf",
"pthread",
},
["system:windows"] = { -- huge sigh
"libprotobuf",
}
},
}
}
Expand Down Expand Up @@ -135,6 +145,15 @@ workspace "lorelai"
symbols "On"
cppdialect "C++17"
flags { "MultiProcessorCompile", "LinkTimeOptimization" }
defines {
"ASMJIT_STATIC"
}

if (os.findheader "lib/libprotobuf.lib") then
libdirs {
os.findheader "lib/libprotobuf.lib" .. "/lib"
}
end

filter "configurations:debug"
defines "DEBUG"
Expand Down Expand Up @@ -184,10 +203,6 @@ workspace "lorelai"
kind "StaticLib"
addincludes "asmjit"

defines {
"ASMJIT_STATIC",
"ASMJIT_TARGET_TYPE=\"STATIC\""
}
filter "platforms:x86 or x86-64"
files {
"asmjit/src/asmjit/x86/**.cpp",
Expand All @@ -198,19 +213,12 @@ workspace "lorelai"
kind "StaticLib"
targetprefix "" -- remove lib from name (linux)
addincludes "liblorelai"
prebuildcommands {
"protoc --proto_path=../src/vm/proto/src --cpp_out=../src/vm/proto ../src/vm/proto/src/bytecode.proto"
}

includedirs { "src/vm" }

pchheader "stdafx.h"
pchsource "src/vm/stdafx.cpp"

links {
"protobuf",
}

addlinks {
"parser",
"asmjit"
Expand Down
2 changes: 1 addition & 1 deletion src/vm/bytecode/expressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static void generate_functioncallexpression(bytecodegenerator &gen, node &_expr,
auto &expr = *dynamic_cast<expressions::functioncallexpression *>(&_expr);
auto &arglist = *dynamic_cast<args *>(expr.arglist.get());

size_t stacksize = std::max(size, static_cast<std::uint32_t>(arglist.children.size() + 1 + (expr.methodname ? 1 : 0)));
std::uint32_t stacksize = std::max(size, static_cast<std::uint32_t>(arglist.children.size() + 1 + (expr.methodname ? 1 : 0)));

bool using_temp = stacksize > size || target == -1;
auto functionindex = target;
Expand Down
2 changes: 2 additions & 0 deletions src/vm/software/gc/gc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ namespace lorelai {
newheap->freeptr = newheap->data;
newheap->mode = true;
heaps[heapcount - 1] = newheap;

return newheap;
}

private:
Expand Down
4 changes: 3 additions & 1 deletion src/vm/software/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,11 @@ namespace lorelai {
auto found = data.find(index);
if (found == data.end()) {
out.unset();
return false;
}
else {
out = found->second;
out.set(found->second);
return true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/runtime/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void print_branch(size_t idx, lorelai::parser::node &node) {
}
}
catch (std::exception &e) {

(e);
}
}

Expand Down

0 comments on commit 00a45f2

Please sign in to comment.