From 96668ecb83f0594e1721091487c07a205905df11 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 9 Feb 2026 23:28:03 +0100 Subject: fix: Guard --headless flag with DEMO_HEADLESS define Prevents user confusion when DEMO_HEADLESS is not defined at compile time. The --headless and --duration flags are now only available when headless support is compiled in. Co-Authored-By: Claude Sonnet 4.5 --- src/main.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cc b/src/main.cc index 58ea124..6132841 100644 --- a/src/main.cc +++ b/src/main.cc @@ -61,11 +61,13 @@ int main(int argc, char** argv) { } } else if (strcmp(argv[i], "--tempo") == 0) { tempo_test_enabled = true; +#if defined(DEMO_HEADLESS) } else if (strcmp(argv[i], "--headless") == 0) { headless_mode = true; } else if (strcmp(argv[i], "--duration") == 0 && i + 1 < argc) { headless_duration = atof(argv[i + 1]); ++i; +#endif } else if (strcmp(argv[i], "--hot-reload") == 0) { hot_reload_enabled = true; printf("Hot-reload enabled (watching config files)\n"); @@ -190,7 +192,7 @@ int main(int argc, char** argv) { } #endif -#if !defined(STRIP_ALL) +#if !defined(STRIP_ALL) && defined(DEMO_HEADLESS) // In headless mode, run simulation without rendering if (headless_mode) { printf("Running headless simulation (%.1fs)...\n", headless_duration); -- cgit v1.2.3