diff options
author | Lingkai Dong <lingkai.dong@arm.com> | 2021-04-21 16:07:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-04-27 18:03:15 (GMT) |
commit | c4941b7e66cd3a0a9de5ed8189ef025fcd6f3122 (patch) | |
tree | c5158533c814362581c1423834fd2238d529e266 /Modules/Compiler/XL-Fortran.cmake | |
parent | 0078db3888e01343d26c1f695b250663bbcb7ac2 (diff) | |
download | CMake-c4941b7e66cd3a0a9de5ed8189ef025fcd6f3122.zip CMake-c4941b7e66cd3a0a9de5ed8189ef025fcd6f3122.tar.gz CMake-c4941b7e66cd3a0a9de5ed8189ef025fcd6f3122.tar.bz2 |
ARMClang: Do not automatically add cpu/arch compile or link options
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
Diffstat (limited to 'Modules/Compiler/XL-Fortran.cmake')
0 files changed, 0 insertions, 0 deletions