The generated flags.make in the cmake build directory DOES add my -march=armv8-a+sve switch to the C_FLAGS variable. I believe that cmake is compiling my file correctly, but I was misled by the incorrectly generated compile_commands.json which is done by CMAKE_EXPORT_COMPILE_COMMANDS.
For -O0, whether -march=native or -march="I want change it to -march=x86-64 in cmake, How to do it? - Find out how exactly PCL adds -march=native flag. If it does that via variable CMAKE_CXX_FLAGS, then you may try to modify that variable (but note about variables scoping rules). If PCL adds the flag to some property, then you may try modify that property. CMake doesn't give you a control over combined compiler flags. You need to ...
-march=foo implies -mtune=foo unless you also specify a different -mtune. This is one reason why using -march is better than just enabling options like -mavx without doing anything about tuning. Caveat: -march=native on a CPU that GCC doesn't specifically recognize will still enable new instruction sets that GCC can detect, but will leave -mtune=generic. Use a new enough GCC that knows about ...
Internet search for "-march=armv8.2-a+i8mm" turns up nearly nothing helpful. Either build_aar.sh is asking for an arch that doesn't make sense, or I need to plug in a version of clang that supports that arch.