Disable target architecture footguns
It's too easy to get onesself into trouble with target architectures. Aside from being smarter about computing CMAKE_SYSTEM_PROCESSOR
appropriately (which may be an ongoing research project), doing the following things would help:
- Prominently document that the architecture of the cmake binary you run will determine the default target architecture and that if you want a different one, you must set
CMAKE_SYSTEM_PROCESSOR
. - Note that if you use vcvars or similar setup tools before running cmake, the default target architecture might be a mismatch with the tools (even though the environment could have been used to inform CMake of a different target architecture).
- Document the valid values of
CMAKE_SYSTEM_PROCESSOR
and make them portable. Right now the documentation is in terms of what values this variable might turn out to have by default, but doesn't clearly describe how it should be controlled. - Supply ARM64 CMake binaries. A windows developer running on ARM64 will naturally install the supplied binaries and be surprised that they get the wrong target architecture. edit: I see now that at least some package systems (e.g. winget) has these.
Edited by Dave Abrahams