Skip to content

Commit f7a5add

Browse files
feat: add experimental Linux build support
Add Linux build support for ArcGameEngine, enabling compilation and execution on Linux systems without modifying any third-party vendor source code. Build Fixes: - Add #include <cstdint> to arcpch.h to provide fixed-width integer types (uint32_t, uint64_t, etc.) before vendor headers are included - Add forceincludes for <cstdint> in JoltPhysics premake5.lua on Linux, since JoltPhysics compiles as a separate static library and does not use Arc's precompiled header - Add build-time patch in GenerateMake.sh that inserts a NULL stub for the missing setWindowTitleBar function pointer in GLFW's x11_init.c platform struct. This is an upstream bug in MohitSethi99/glfw where the X11 platform struct initializer is missing the setWindowTitleBar entry that exists in win32_init.c and null_init.c, causing every function pointer after it to be assigned to the wrong slot Documentation: - Add Linux build section to README with dependency installation and build instructions for Ubuntu/Debian - Update platform badge to reflect Windows (Primary) | Linux (Experimental) Tested on Ubuntu/Debian with Clang 18.1.3. The full project (all vendor libraries, Arc core, and Arc-Editor) builds and runs successfully.
1 parent 14739ba commit f7a5add

4 files changed

Lines changed: 37 additions & 7 deletions

File tree

Arc/src/arcpch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#endif
1010
#endif
1111

12+
#include <cstdint>
1213
#include <sstream>
1314

1415
#include <future>

Arc/vendor/JoltPhysics/premake5.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ project "JoltPhysics"
3434
pic "On"
3535
systemversion "latest"
3636
cppdialect "C++20"
37-
38-
filter "configurations:Debug"
39-
runtime "Debug"
40-
symbols "on"
37+
forceincludes { "cstdint" }
4138

4239
filter "configurations:Release"
4340
runtime "Release"

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=MohitSethi99_ArcGameEngine&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=MohitSethi99_ArcGameEngine)
77
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=MohitSethi99_ArcGameEngine&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=MohitSethi99_ArcGameEngine)
88

9-
![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux-blue?style=flat-square)
9+
![Platform](https://img.shields.io/badge/platform-Windows%20%28Primary%29%20%7C%20Linux%20%28Experimental%29-blue?style=flat-square)
1010
![GitHub](https://img.shields.io/github/license/MohitSethi99/ArcEngine?color=blue&style=flat-square)
1111
![Size](https://img.shields.io/github/repo-size/MohitSethi99/ArcEngine?style=flat-square)
1212

@@ -24,8 +24,27 @@ I develop it in my spare time as a personal project, so expect frequent periods
2424
```
2525
git clone --recursive https://github.com/MohitSethi99/ArcGameEngine.git
2626
```
27-
- Arc Game Engine is built in a Windows environment, using Visual Studio 2022.
28-
- Execute the script `scripts/Win-GenProjects.bat` to generate the solution and project files.
27+
28+
### Windows
29+
- Arc Game Engine is primarily developed in a Windows environment using Visual Studio 2022.
30+
- Run `scripts/Win-GenProjects.bat` to generate the solution and project files.
31+
32+
### Linux (Experimental)
33+
Linux support is available but experimental. Tested with Clang 18.1.3 on Ubuntu/Debian.
34+
35+
1. Install dependencies:
36+
```bash
37+
# Debian/Ubuntu
38+
sudo apt install build-essential clang libc++-dev libstdc++-14-dev
39+
# Or use the provided script:
40+
./scripts/InstallDependencies.sh
41+
```
42+
2. Generate Makefiles and build:
43+
```bash
44+
./scripts/GenerateMake.sh && make config=debug -j$(nproc)
45+
```
46+
47+
> **Note:** Windows remains the primary development platform. Linux builds may require additional maintenance as the project evolves.
2948
3049
## Current Features
3150

scripts/GenerateMake.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
14
chmod +x vendor/premake/bin/premake5
5+
6+
# Patch GLFW x11_init.c: insert missing setWindowTitleBar function pointer (NULL stub)
7+
# The upstream GLFW fork is missing this entry in the X11 platform struct, causing
8+
# every function pointer after it to be assigned to the wrong slot.
9+
GLFW_X11_INIT="Arc/vendor/GLFW/src/x11_init.c"
10+
if [ -f "$GLFW_X11_INIT" ] && ! grep -q "setWindowTitleBar" "$GLFW_X11_INIT"; then
11+
sed -i '/_glfwPostEmptyEventX11,/a\ NULL, // setWindowTitleBar - stub for X11 (not implemented)' "$GLFW_X11_INIT"
12+
echo "Patched $GLFW_X11_INIT: added missing setWindowTitleBar NULL stub"
13+
fi
14+
215
./vendor/premake/bin/premake5 gmake2 --cc=clang --dotnet=mono

0 commit comments

Comments
 (0)