0002-source-CMakeLists.txt-allow-setting-CPU_HAS_NEON-whe.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 0088d29e7c75ea7f100a100aea4e2a797469427f Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  3. Date: Sat, 13 Jul 2024 10:10:54 +0200
  4. Subject: [PATCH] source/CMakeLists.txt: allow setting CPU_HAS_NEON when
  5. CROSS_COMPILE_ARM
  6. The logic in source/cmake/FindNeon.cmake is not appropriate for
  7. cross-compilation scenarios, so in order to allow cross-compiling for
  8. ARM, CROSS_COMPILE_ARM needs to be defined. However that currently
  9. doesn't allow the enabling of NEON support, so let's allow the user to
  10. manually set CPU_HAS_NEON in this case.
  11. Upstream: https://bitbucket.org/multicoreware/x265_git/pull-requests/26
  12. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  13. ---
  14. source/CMakeLists.txt | 7 ++++++-
  15. 1 file changed, 6 insertions(+), 1 deletion(-)
  16. diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
  17. index a34bf4d4f..072bf62ab 100755
  18. --- a/source/CMakeLists.txt
  19. +++ b/source/CMakeLists.txt
  20. @@ -239,8 +239,13 @@ if(GCC)
  21. endif()
  22. endif()
  23. if(ARM AND CROSS_COMPILE_ARM)
  24. - set(ARM_ARGS -fPIC)
  25. message(STATUS "cross compile arm")
  26. + if(CPU_HAS_NEON)
  27. + set(ARM_ARGS -mfpu=neon -fPIC)
  28. + add_definitions(-DHAVE_NEON)
  29. + else()
  30. + set(ARM_ARGS -fPIC)
  31. + endif()
  32. elseif(ARM)
  33. if(ARM64)
  34. set(ARM_ARGS -fPIC)
  35. --
  36. 2.45.2