FindNeon.cmake seems to always detect neon feature
Hi, I noticed that neon got enabled even when there was no neon feature in proc/cpuinfo
and I think it happen because of how execute_process
is used.
From cmake documentation https://cmake.org/cmake/help/latest/command/execute_process.html
COMMAND
A child process command line.
CMake executes the child process using operating system APIs directly. All arguments are passed VERBATIM to the child process. No intermediate shell is used, so shell operators such as
>
are treated as normal arguments. (Use theINPUT_*
,OUTPUT_*
, andERROR_*
options to redirect stdin, stdout, and stderr.)If a sequential execution of multiple commands is required, use multiple
execute_process()
calls with a singleCOMMAND
argument.
So I think:
execute_process(COMMAND cat /proc/cpuinfo | grep Features | grep neon
OUTPUT_VARIABLE neon_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
Should be replaced with:
execute_process(COMMAND sh -c "cat /proc/cpuinfo | grep Features | grep neon"
OUTPUT_VARIABLE neon_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
Then it seems to work as it was intended (otherwise cat
will get pipes and everything as filename arguments)