Skip to content

Conversation

@stevezxc
Copy link
Contributor

Separated the launcher for GUI and headless modes #2179

Copilot AI review requested due to automatic review settings January 20, 2026 15:48
Copy link

Copilot AI left a 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_BUILD preprocessor 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
Copy link

Copilot AI Jan 20, 2026

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.

Suggested change
#endif
#endif
return 0;

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +13
#ifndef HEADLESS_BUILD

#define GLFW_EXPOSE_NATIVE_X11
#include <GLFW/glfw3.h>
#include <GLFW/glfw3native.h>

#endif
Copy link

Copilot AI Jan 20, 2026

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.

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 20, 2026

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".

Suggested change
// 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

Copilot uses AI. Check for mistakes.
@schombert schombert merged commit 870a08e into schombert:main Jan 20, 2026
8 of 11 checks passed
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.

2 participants