From 942e19682b2d954ac823301838735c3ea414d882 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Wed, 22 Dec 2021 17:38:59 +0100 Subject: [PATCH] Android cross-compilable gnss-sdr, initial commit, hardcoded paths in CMakefiles --- .../conditioner/adapters/CMakeLists.txt | 1 + src/main/CMakeLists.txt | 29 +++++++++++++++++-- src/utils/front-end-cal/CMakeLists.txt | 24 +++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index cb4db5424..b5fc8ce83 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -37,6 +37,7 @@ endif() target_link_libraries(conditioner_adapters PUBLIC Gnuradio::runtime + Boost::headers PRIVATE Gflags::gflags Glog::glog diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 67520f45b..c4a360e62 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -3,7 +3,7 @@ # # SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es # SPDX-License-Identifier: BSD-3-Clause - + if(USE_CMAKE_TARGET_SOURCES) add_executable(gnss-sdr) @@ -12,8 +12,31 @@ else() add_executable(gnss-sdr main.cc) endif() +add_library(libusb SHARED IMPORTED) +set_target_properties(libusb PROPERTIES IMPORTED_LOCATION + /home/android/src/gnuradio-android/toolchain/arm64-v8a/lib/libusb1.0.so) + + +add_library(libcrypto SHARED IMPORTED) +set_target_properties(libcrypto PROPERTIES IMPORTED_LOCATION + /home/android/src/gnuradio-android/toolchain/arm64-v8a/lib/libcrypto.so.3) + +add_library(libhackrf SHARED IMPORTED) +set_target_properties(libhackrf PROPERTIES IMPORTED_LOCATION + /home/android/src/gnuradio-android/toolchain/arm64-v8a/lib/libhackrf.so) + +add_library(librtlsdr SHARED IMPORTED) +set_target_properties(librtlsdr PROPERTIES IMPORTED_LOCATION + /home/android/src/gnuradio-android/toolchain/arm64-v8a/lib/librtlsdr.so) + + target_link_libraries(gnss-sdr - PRIVATE + PUBLIC + libusb + libcrypto + libhackrf + librtlsdr + PRIVATE algorithms_libs core_receiver Boost::headers @@ -21,6 +44,8 @@ target_link_libraries(gnss-sdr Gflags::gflags Glog::glog Threads::Threads + log + android ) target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}") diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 2fc93dad4..6ed8021de 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -28,6 +28,8 @@ target_link_libraries(front_end_cal_lib algorithms_libs core_receiver core_libs + log + android PRIVATE Boost::headers Gflags::gflags @@ -52,8 +54,30 @@ else() add_executable(front-end-cal main.cc) endif() + +add_library(libusb SHARED IMPORTED) +set_target_properties(libusb PROPERTIES IMPORTED_LOCATION + /home/android/src/gnuradio-android/toolchain/arm64-v8a/lib/libusb1.0.so) + +add_library(libcrypto SHARED IMPORTED) +set_target_properties(libcrypto PROPERTIES IMPORTED_LOCATION + /home/android/src/gnuradio-android/toolchain/arm64-v8a/lib/libcrypto.so.3) + +add_library(libhackrf SHARED IMPORTED) +set_target_properties(libhackrf PROPERTIES IMPORTED_LOCATION + /home/android/src/gnuradio-android/toolchain/arm64-v8a/lib/libhackrf.so) + +add_library(librtlsdr SHARED IMPORTED) +set_target_properties(librtlsdr PROPERTIES IMPORTED_LOCATION + /home/android/src/gnuradio-android/toolchain/arm64-v8a/lib/librtlsdr.so) + + target_link_libraries(front-end-cal PRIVATE + libusb + libcrypto + libhackrf + librtlsdr core_receiver algorithms_libs front_end_cal_lib