-
Notifications
You must be signed in to change notification settings - Fork 79
headless mode #2218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
headless mode #2218
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request aims to add headless build support to the launcher to remove the hard X11 requirement on *nix systems, addressing issue #2179. The changes introduce conditional compilation using the HEADLESS_BUILD preprocessor macro to separate GUI-dependent code from headless mode code.
Changes:
- Added
HEADLESS_BUILDpreprocessor guards around X11/GLFW-dependent code - Implemented headless-specific fallbacks for MessageBox and game launching
- Fixed indentation for existing preprocessor directives
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } | ||
|
|
||
| #endif |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return statement at the end of main() has been removed. Both code paths (GUI and headless) should return a value. Add 'return 0;' after the closing endif to ensure the function returns in all code paths.
| #endif | |
| #endif | |
| return 0; |
| #ifndef HEADLESS_BUILD | ||
|
|
||
| #define GLFW_EXPOSE_NATIVE_X11 | ||
| #include <GLFW/glfw3.h> | ||
| #include <GLFW/glfw3native.h> | ||
|
|
||
| #endif |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code uses the HEADLESS_BUILD preprocessor macro, but there is no corresponding build system configuration to define this macro. The build system (CMakeLists.txt) needs to be updated to support building with HEADLESS_BUILD defined. Without this, the headless-specific code will never be compiled, and the GLFW/X11 dependencies will still be required.
| if(file_is_ready.load(std::memory_order_acquire) && !selected_scenario_file.empty()) { | ||
| std::string alicePath; | ||
| __builtin_cpu_init(); | ||
| // check if cpu supports avx. If it supports neither then fallbackt to SSE |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error in the comment: "fallbackt" should be "fallback".
| // check if cpu supports avx. If it supports neither then fallbackt to SSE | |
| // check if cpu supports avx. If it supports neither then fallback to SSE |
Separated the launcher for GUI and headless modes #2179