Skip to content

Fix NO_VM_COMPILED CMake wiring for unsupported CPU builds#54

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/stale-feature-flag-cleanup-33a5
Draft

Fix NO_VM_COMPILED CMake wiring for unsupported CPU builds#54
cursor[bot] wants to merge 1 commit intomainfrom
cursor/stale-feature-flag-cleanup-33a5

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor bot commented Apr 9, 2026

Summary

Corrects the QVM JIT vs interpreter build selection in the top-level CMakeLists.txt. The previous ELSE() branch called target_compile_definitions on qcommon / qcommon_ded before those targets were created (invalid CMake), and the follow-up IF(NO_VM_COMPILED) never ran because NO_VM_COMPILED was never set.

Flags removed / gates simplified

  • Build-time NO_VM_COMPILED gate: The dead/invalid path that tried to apply -DNO_VM_COMPILED in the CPU ELSE() before add_library(qcommon …) is removed. The macro is now applied only after qcommon / qcommon_ded exist, when no JIT backend source is selected.

Why this is safe to change

  • Supported architectures (x86/x86_64, aarch64, arm*, ppc64*) still append the same vm_*.c files as before; NO_VM_COMPILED stays off, matching prior intent.
  • Unsupported / novel CPUs now reliably get NO_VM_COMPILED=1 instead of silently building without the define (which could mismatch vm.c expectations vs. accidentally linked JIT objects).

Behavioral parity checks

  • cmake -B … -S . -G Ninja on native x86_64: configures successfully; cmake --build … --target qcommon qcommon_ded succeeds.
  • Fresh configure with -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=riscv64: build.ninja shows -DNO_VM_COMPILED=1 on qcommon sources and no vm_x86.c (etc.) objects; cmake --build … --target qcommon succeeds.

Notes

  • This repository does not use web-style “feature flag” services; engine toggles are primarily cvars and compile-time defines. Runtime cvars such as r_ext_* remain user-tunable and were not removed.
Open in Web View Automation 

- Track NO_VM_COMPILED during CPU branch selection instead of calling
  target_compile_definitions before qcommon targets exist (invalid CMake).
- Apply NO_VM_COMPILED=1 to qcommon and qcommon_ded only when no JIT
  backend is selected (e.g. RISC-V cross builds).
- Normalize elseif chain indentation for PowerPC.

Co-authored-by: Tim Fox <timfox@outlook.com>
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