From f39143bc2ed4eb33bb85a3d923cb457384141bf8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 1 Mar 2021 19:15:29 +0100 Subject: CMake: reduce Neon related output on Intel platforms * Only try to find sse2neon if Neon detected * Only run Neon support test once --- build_files/cmake/macros.cmake | 12 +++++++----- build_files/cmake/platform/platform_apple.cmake | 2 +- build_files/cmake/platform/platform_unix.cmake | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'build_files') diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index b8f92a10761..cad1d86b75a 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -682,11 +682,13 @@ macro(TEST_SSE_SUPPORT endmacro() macro(TEST_NEON_SUPPORT) - include(CheckCXXSourceCompiles) - check_cxx_source_compiles( - "#include - int main() {return vaddvq_s32(vdupq_n_s32(1));}" - SUPPORT_NEON_BUILD) + if(NOT DEFINED SUPPORT_NEON_BUILD) + include(CheckCXXSourceCompiles) + check_cxx_source_compiles( + "#include + int main() {return vaddvq_s32(vdupq_n_s32(1));}" + SUPPORT_NEON_BUILD) + endif() endmacro() # Only print message if running CMake first time diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake index 12a7a6c504f..be9261798f4 100644 --- a/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake @@ -324,7 +324,7 @@ if(WITH_NANOVDB) find_package(NanoVDB) endif() -if(WITH_CPU_SIMD) +if(WITH_CPU_SIMD AND SUPPORT_NEON_BUILD) find_package(sse2neon) endif() diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index ef73ef40ac3..47c788c7eb6 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -285,7 +285,7 @@ if(WITH_NANOVDB) endif() endif() -if(WITH_CPU_SIMD) +if(WITH_CPU_SIMD AND SUPPORT_NEON_BUILD) find_package_wrapper(sse2neon) endif() -- cgit v1.2.3