Skip to content

Comments

feat: Add experimental Linux build support#25

Open
killerdevildog wants to merge 1 commit intoGloriousPtr:mainfrom
killerdevildog:fix/linux-build-dependencies
Open

feat: Add experimental Linux build support#25
killerdevildog wants to merge 1 commit intoGloriousPtr:mainfrom
killerdevildog:fix/linux-build-dependencies

Conversation

@killerdevildog
Copy link

@killerdevildog killerdevildog commented Jul 17, 2025

Summary

Add experimental Linux build support for ArcGameEngine. The project now compiles and runs on Linux without modifying any third-party vendor source code.

What Works

  • Full project builds successfully on Linux (all vendor libraries, Arc core engine, and Arc-Editor)
  • Arc-Editor launches and runs on Linux/X11
  • No third-party/vendor source files are modified — all fixes are applied through project-owned build configuration and scripts

Changes

Arc/src/arcpch.h

  • Add #include <cstdint> to the precompiled header, ensuring fixed-width integer types (uint32_t, uint64_t, etc.) are available before any vendor headers are included.

Arc/vendor/JoltPhysics/premake5.lua

  • Add forceincludes { "cstdint" } under the Linux filter. JoltPhysics compiles as a separate static library with its own translation units, so it does not use Arc's precompiled header. This ensures <cstdint> is implicitly included before each JoltPhysics source file on Linux.

scripts/GenerateMake.sh

  • Add a build-time patch that inserts a NULL stub for the missing setWindowTitleBar function pointer in GLFW's x11_init.c. The patch is idempotent (only applies if not already present) and includes a guard to prevent double-application.

    Background: The upstream GLFW fork (MohitSethi99/glfw) has a bug where the X11 platform struct initializer is missing the setWindowTitleBar entry that exists in both win32_init.c and null_init.c. This causes every function pointer after that slot to be assigned to the wrong position, resulting in type mismatch compilation errors. The Wayland init (wl_init.c) has the same issue.

README.md

  • Add Linux build section with dependency installation instructions and build commands
  • Update platform badge to reflect Windows (Primary) | Linux (Experimental)

Known Limitations / Future Work

These should be addressed in separate PRs:

  1. GLFW upstream fix needed — The setWindowTitleBar function pointer is missing from both x11_init.c and wl_init.c in MohitSethi99/glfw. A PR should be submitted to that repo to add the proper function entries. Once merged, the build-time patch in GenerateMake.sh can be removed.

  2. Wayland support — The build currently targets X11 only. Wayland has the same missing function pointer issue and is not yet tested.

  3. Shader warnings — The editor runs but produces m_Params used uninitialized shader warnings at startup. These are pre-existing and not related to this PR.

  4. CI/CD — No Linux CI pipeline exists yet. A GitHub Actions workflow for Linux builds would help catch regressions.

Testing

  • OS: Ubuntu/Debian
  • Compiler: Clang 18.1.3
  • Dependencies: build-essential, clang, libc++-dev, libstdc++-14-dev
  • All vendor libraries compile without errors
  • Arc core engine library links successfully
  • Arc-Editor builds and launches on X11

@killerdevildog killerdevildog changed the title Fix/linux build dependencies feat: Add experimental Linux build support Feb 20, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant