summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-09 23:28:03 +0100
committerskal <pascal.massimino@gmail.com>2026-02-09 23:28:03 +0100
commit96668ecb83f0594e1721091487c07a205905df11 (patch)
tree695dd4480accd3486f17a02c2ddd2f3714994f4c /src/main.cc
parenteff8d43479e7704df65fae2a80eefa787213f502 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc4
1 files changed, 3 insertions, 1 deletions
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);