cmake: honor DISPATCH=OFF #1160

Open
fhgffy wants to merge 1 commit from fhgffy/fix/cmake-dispatch-off into dev
fhgffy commented 2026-10-05 07:14:59 -05:00 (Migrated from github.com)

The dispatch condition checks whether DISPATCH is defined, so configuring with -DDISPATCH=OFF still compiles the x86 dispatcher and enables it in xxhsum. On x86_64, the resulting executable reports autoVec despite the option being OFF.

Check the value of DISPATCH instead. This preserves the existing behavior when the variable is unset or ON.

Add a check to the Linux CMake job that builds with ON, reconfigures the same directory with OFF, and checks the resulting executable each time. It fails on the current dev branch and passes with this change.

Tested with CMake 3.31.6 and GCC 14.2.0 on Linux x86_64, including shared/static builds and installed CMake consumers. make SHELL=/bin/bash test MOREFLAGS='-Werror -Wconversion' passes. The larger test-all target stops at the 32-bit build because this environment lacks multilib libc headers.

The dispatch condition checks whether DISPATCH is defined, so configuring with `-DDISPATCH=OFF` still compiles the x86 dispatcher and enables it in xxhsum. On x86_64, the resulting executable reports `autoVec` despite the option being OFF. Check the value of DISPATCH instead. This preserves the existing behavior when the variable is unset or ON. Add a check to the Linux CMake job that builds with ON, reconfigures the same directory with OFF, and checks the resulting executable each time. It fails on the current dev branch and passes with this change. Tested with CMake 3.31.6 and GCC 14.2.0 on Linux x86_64, including shared/static builds and installed CMake consumers. `make SHELL=/bin/bash test MOREFLAGS='-Werror -Wconversion'` passes. The larger `test-all` target stops at the 32-bit build because this environment lacks multilib libc headers.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'fhgffy/fix/cmake-dispatch-off:fhgffy/fix/cmake-dispatch-off'
git switch 'fhgffy/fix/cmake-dispatch-off'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'dev'
git merge --no-ff 'fhgffy/fix/cmake-dispatch-off'
git switch 'fhgffy/fix/cmake-dispatch-off'
git rebase 'dev'
git switch 'dev'
git merge --ff-only 'fhgffy/fix/cmake-dispatch-off'
git switch 'fhgffy/fix/cmake-dispatch-off'
git rebase 'dev'
git switch 'dev'
git merge --no-ff 'fhgffy/fix/cmake-dispatch-off'
git switch 'dev'
git merge --squash 'fhgffy/fix/cmake-dispatch-off'
git switch 'dev'
git merge --ff-only 'fhgffy/fix/cmake-dispatch-off'
git switch 'dev'
git merge 'fhgffy/fix/cmake-dispatch-off'
git push origin 'dev'
Sign in to join this conversation.
No description provided.