Skip to content

Commit

Permalink
Reworked ARM Neon detection and remote plugins inclusion in the build
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Nov 23, 2020
1 parent f155d63 commit 4059a0b
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 29 deletions.
8 changes: 7 additions & 1 deletion cmake/Modules/DetectArchitecture.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,14 @@ if (ARCHITECTURE_ARM)
endif()
endif()

# Extensions detection for ARM
check_symbol_exists("__ARM_NEON" "" HAS_NEON)
if (HAS_NEON)
message(STATUS "ARM Neon extensions enabled")
add_compile_definitions(USE_NEON)
endif()

# This is quite basic detection, can be extended if needed
detect_extensions(ARM_NEON)
detect_extensions(AVX512F)
detect_extensions(AVX2 HAS_AVX512F)
detect_extensions(AVX HAS_AVX2)
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ if(LIBDSDCC_FOUND AND LIBMBE_FOUND)
add_subdirectory(demoddsd)
endif(LIBDSDCC_FOUND AND LIBMBE_FOUND)

if(CM256CC_FOUND)
if (CM256CC_FOUND AND (HAS_SSE3 OR HAS_NEON))
add_subdirectory(remotesink)
endif(CM256CC_FOUND)
endif()

if (CODEC2_FOUND)
add_subdirectory(demodfreedv)
Expand Down
5 changes: 0 additions & 5 deletions plugins/channelrx/remotesink/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
project(remotesink)

if (ARCHITECTURE_ARM64)
message(STATUS "Compiling RemoteSink for ARM64 with USE_NEON definition")
add_compile_definitions(USE_NEON)
endif()

set(remotesink_SOURCES
remotesink.cpp
remotesinkbaseband.cpp
Expand Down
4 changes: 2 additions & 2 deletions plugins/channeltx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ add_subdirectory(udpsource)
add_subdirectory(localsource)
add_subdirectory(filesource)

if(CM256CC_FOUND)
if (CM256CC_FOUND AND (HAS_SSE3 OR HAS_NEON))
add_subdirectory(remotesource)
endif(CM256CC_FOUND)
endif()

if (OpenCV_FOUND)
add_subdirectory(modatv)
Expand Down
5 changes: 0 additions & 5 deletions plugins/channeltx/remotesource/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
project(remotesource)

if (ARCHITECTURE_ARM64)
message(STATUS "Compiling RemoteSource for ARM64 with USE_NEON definition")
add_compile_definitions(USE_NEON)
endif()

set(remotesource_SOURCES
remotesource.cpp
remotesourcebaseband.cpp
Expand Down
4 changes: 2 additions & 2 deletions plugins/samplesink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ add_subdirectory(fileoutput)
add_subdirectory(localoutput)
add_subdirectory(audiooutput)

if(CM256CC_FOUND)
if (CM256CC_FOUND AND (HAS_SSE3 OR HAS_NEON))
add_subdirectory(remoteoutput)
endif(CM256CC_FOUND)
endif()

if(ENABLE_BLADERF AND LIBBLADERF_FOUND)
add_subdirectory(bladerf1output)
Expand Down
5 changes: 0 additions & 5 deletions plugins/samplesink/remoteoutput/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
project(remoteoutput)

if (ARCHITECTURE_ARM64)
message(STATUS "Compiling RemoteOutput for ARM64 with USE_NEON definition")
add_compile_definitions(USE_NEON)
endif()

set(remoteoutput_SOURCES
remoteoutput.cpp
remoteoutputplugin.cpp
Expand Down
4 changes: 2 additions & 2 deletions plugins/samplesource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ add_subdirectory(fileinput)
add_subdirectory(testsource)
add_subdirectory(localinput)

if(CM256CC_FOUND)
if (CM256CC_FOUND AND (HAS_SSE3 OR HAS_NEON))
add_subdirectory(remoteinput)
endif(CM256CC_FOUND)
endif()

if(ENABLE_AIRSPY AND LIBAIRSPY_FOUND)
add_subdirectory(airspy)
Expand Down
5 changes: 0 additions & 5 deletions plugins/samplesource/remoteinput/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
project(remoteinput)

if (ARCHITECTURE_ARM64)
message(STATUS "Compiling RemoteInput for ARM64 with USE_NEON definition")
add_compile_definitions(USE_NEON)
endif()

set(remoteinput_SOURCES
remoteinputbuffer.cpp
remoteinputudphandler.cpp
Expand Down

0 comments on commit 4059a0b

Please sign in to comment.