From 5e83137736285e0238d46a008d0a481ff21c5907 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 12 Nov 2025 16:09:18 +0100 Subject: checkpoint --- code/build.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 code/build.cpp (limited to 'code/build.cpp') diff --git a/code/build.cpp b/code/build.cpp new file mode 100644 index 0000000..9583de3 --- /dev/null +++ b/code/build.cpp @@ -0,0 +1,25 @@ +#include "libs/build.h" + +int main(int ArgsCount, char *Args[], char *Env[]) +{ + LinuxChangeToExecutableDirectory(Args); + LinuxRebuildSelf(ArgsCount, Args, Env); + + printf("[linux handmade compile]\n"); + str8_list BuildCommandList = CommonBuildCommand(false, true ,true); + Str8ListAppend(&BuildCommandList, + S8Lit("-DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1 -DHANDMADE_SMALL_RESOLUTION=1 " + "-lX11 -lXfixes -lasound -lcurl " + "-o linux_handmade " + "../code/libs/hm_linux/linux_handmade.cpp")); + str8 BuildCommand = Str8ListJoin(BuildCommandList, sizeof(OutputBuffer), OutputBuffer, ' '); + + linux_command_result CommandResult = LinuxRunCommandString(BuildCommand, Env, true); + smm BytesToRead = LinuxErrorWrapperRead(CommandResult.Stderr, OutputBuffer, CommandResult.StderrBytesToRead); + if(BytesToRead) + { + printf("%*s", (int)BytesToRead, OutputBuffer); + } + + return 0; +} -- cgit v1.2.3-70-g09d2