mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
The compile options `--march=<arch>` and `--mcpu=<cpu>` and the
link option `--cpu=<cpu>` are automatically added by CMake based
on `CMAKE_SYSTEM_PROCESSOR` or `CMAKE_SYSTEM_ARCH`. But this is not
sufficient, because armclang also supports enabling or disabling
features using `+<feature>`:
-mcpu=<name>[+[no]<feature>+...]
For example:
-mcpu=cortex-a57+nocrypto+nofp+nosimd+crc
(Reference: https://developer.arm.com/documentation/dui0774/k/Compiler-Command-line-Options/-mcpu?lang=en)
The problem is, even if a project adds a flag with features it needs,
CMake still adds flags, resulting in code that is compiled with wrong
CPU features and unable to run.
Add policy `CMP0123` to not automatically add compile or link options,
and let projects set them instead.
Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21173
8 lines
311 B
ReStructuredText
8 lines
311 B
ReStructuredText
ARMClang-cpu-arch-flags
|
|
-----------------------
|
|
|
|
* ``ARMClang`` cpu/arch compile and link flags are no longer added
|
|
automatically based on the :variable:`CMAKE_SYSTEM_PROCESSOR`
|
|
variable or the undocumented ``CMAKE_SYSTEM_ARCH`` variable.
|
|
They must be specified explicitly. See policy :policy:`CMP0123`.
|