Skip to content

Commit

Permalink
Fix the compilation of the client with packer
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Oct 8, 2024
1 parent 77c3031 commit 4f0b66e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules/
.prettierignore
tsconfig.tsbuildinfo
*~
*.wat
*.wat
packer
49 changes: 26 additions & 23 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,31 @@ if (!0) {
"stb_image.h"
]).on('close', (data) => {
if (data !== 0) return;
cmd("c3c", [
"compile",
"-D", "PLATFORM_WEB",
"--reloc=none",
"--target", "wasm32",
"-O5", "-g0", "--link-libc=no", "--no-entry",
"--trust=full",
"-o", "client",
"-z", "--export-table",
"-z", "--allow-undefined",
"client.c3", "common.c3",
])
cmd("c3c", [
"compile",
"-D", "PLATFORM_WEB",
"--reloc=none",
"--target", "wasm32",
"-O5", "-g0", "--link-libc=no", "--no-entry",
"-o", "server",
"-z", "--export-table",
"-z", "--allow-undefined",
"server.c3", "common.c3",
])
cmd("c3c", ["compile", "packer.c3", "common.c3", "stb_image.o"]).on('close', (data) => {
if (data !== 0) return;
cmd("c3c", [
"compile",
"-D", "PLATFORM_WEB",
"--reloc=none",
"--target", "wasm32",
"-O5", "-g0", "--link-libc=no", "--no-entry",
"--trust=full",
"-o", "client",
"-z", "--export-table",
"-z", "--allow-undefined",
"client.c3", "common.c3",
])
});
})
cmd("c3c", [
"compile",
"-D", "PLATFORM_WEB",
"--reloc=none",
"--target", "wasm32",
"-O5", "-g0", "--link-libc=no", "--no-entry",
"-o", "server",
"-z", "--export-table",
"-z", "--allow-undefined",
"server.c3", "common.c3",
])
}
2 changes: 1 addition & 1 deletion client.c3
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const float MINIMAP_SCALE = 0.07;

const uint SPRITE_ANGLES_COUNT = 8;

$exec("packer.c3;common.c3;stb_image.o");
$exec("./packer");

def Color = char[<4>];

Expand Down

0 comments on commit 4f0b66e

Please sign in to comment.