vid.stab
vid.stab copied to clipboard
FindSSE.cmake causes false positives when cross compiling
On Alpine Linux we're currently porting the system to riscv64. While building vid.stab, it appeared the build system was trying to use the -msse2
compiler option, while this option is not supported on this architecture.
Looking at the CMake code this is because CMake checks the output of /proc/cpuinfo
for mentions of SSE support. However, this assumes that the architecture of the CPU building the package is also the target architecture, which in this case is not true as we're cross compiling it.
So it sees that the CPU building the package is x86_64 and supports SSE, even though the target architecture is riscv64 which does not support SSE. This obviously breaks compilation.
Adding -DSSE2_FOUND=False
to the CMake options for this particular architecture fixes the problem.
I am not so familiar with the CMake stuff. If you have a fix that would solve it in a good way and allow for the option of cross-platform compilation I would be happy for a merge request.
@PureTryOut thank you!
it is similar to https://github.com/Framstag/libosmscout/pull/1198 , it is necessary to try_compile
sse code to verify availability...
If I read correctly this was fixed by https://github.com/georgmartius/vid.stab/pull/114 already, so can be resolved.