mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 04:37:37 +01:00
android fixes
This commit is contained in:
parent
ce3fea3747
commit
72b895fc67
@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
buildToolsVersion "30.0.3"
|
buildToolsVersion "30.0.3"
|
||||||
ndkVersion "23.0.7599858"
|
ndkVersion "25.1.8937393"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "org.sdrpp.sdrpp"
|
applicationId "org.sdrpp.sdrpp"
|
||||||
minSdkVersion 28
|
minSdkVersion 28
|
||||||
@ -14,7 +14,7 @@ android {
|
|||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
arguments "-DOPT_BACKEND_GLFW=OFF", "-DOPT_BACKEND_ANDROID=ON", "-DOPT_BUILD_SOAPY_SOURCE=OFF", "-DOPT_BUILD_ANDROID_AUDIO_SINK=ON", "-DOPT_BUILD_AUDIO_SINK=OFF", "-DOPT_BUILD_DISCORD_PRESENCE=OFF", "-DOPT_BUILD_M17_DECODER=ON"
|
arguments "-DOPT_BACKEND_GLFW=OFF", "-DOPT_BACKEND_ANDROID=ON", "-DOPT_BUILD_SOAPY_SOURCE=OFF", "-DOPT_BUILD_ANDROID_AUDIO_SINK=ON", "-DOPT_BUILD_AUDIO_SINK=OFF", "-DOPT_BUILD_DISCORD_PRESENCE=OFF", "-DOPT_BUILD_M17_DECODER=OFF", "-DOPT_BUILD_PLUTOSDR_SOURCE=OFF"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,17 +108,15 @@ if (MSVC)
|
|||||||
target_link_libraries(sdrpp_core PUBLIC zstd::libzstd_shared)
|
target_link_libraries(sdrpp_core PUBLIC zstd::libzstd_shared)
|
||||||
elseif (ANDROID)
|
elseif (ANDROID)
|
||||||
target_include_directories(sdrpp_core PUBLIC
|
target_include_directories(sdrpp_core PUBLIC
|
||||||
../android/deps/volk/jni
|
/sdr-kit/${ANDROID_ABI}/include
|
||||||
../android/deps/fftw3/jni
|
|
||||||
/mnt/android_sdr/zstd/lib
|
|
||||||
${ANDROID_NDK}/sources/android/native_app_glue
|
${ANDROID_NDK}/sources/android/native_app_glue
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(sdrpp_core PUBLIC
|
target_link_libraries(sdrpp_core PUBLIC
|
||||||
${PROJECT_SOURCE_DIR}/../android/deps/volk/${ANDROID_ABI}/libcpu_features.a
|
/sdr-kit/${ANDROID_ABI}/lib/libcpu_features.a
|
||||||
${PROJECT_SOURCE_DIR}/../android/deps/volk/${ANDROID_ABI}/libvolk.so
|
/sdr-kit/${ANDROID_ABI}/lib/libvolk.so
|
||||||
${PROJECT_SOURCE_DIR}/../android/deps/fftw3/${ANDROID_ABI}/libfftw3f.a
|
/sdr-kit/${ANDROID_ABI}/lib/libfftw3f.so
|
||||||
/mnt/android_sdr/output/zstd/${ANDROID_ABI}/libzstd.so
|
/sdr-kit/${ANDROID_ABI}/lib/libzstd.so
|
||||||
android
|
android
|
||||||
EGL
|
EGL
|
||||||
GLESv3
|
GLESv3
|
||||||
|
@ -26,13 +26,12 @@ if (MSVC)
|
|||||||
target_link_libraries(airspy_source PRIVATE airspy)
|
target_link_libraries(airspy_source PRIVATE airspy)
|
||||||
elseif (ANDROID)
|
elseif (ANDROID)
|
||||||
target_include_directories(airspy_source PUBLIC
|
target_include_directories(airspy_source PUBLIC
|
||||||
/mnt/android_sdr/libusb/libusb
|
/sdr-kit/${ANDROID_ABI}/include/libairspy
|
||||||
/mnt/android_sdr/airspyone_host/libairspy/src
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(airspy_source PUBLIC
|
target_link_libraries(airspy_source PUBLIC
|
||||||
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
|
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
|
||||||
/mnt/android_sdr/output/libairspy/${ANDROID_ABI}/libairspy.so
|
/sdr-kit/${ANDROID_ABI}/lib/libairspy.so
|
||||||
)
|
)
|
||||||
else (MSVC)
|
else (MSVC)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
|
@ -131,7 +131,7 @@ public:
|
|||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
int err = airspy_open_sn(&dev, serial);
|
int err = airspy_open_sn(&dev, serial);
|
||||||
#else
|
#else
|
||||||
int err = airspy_open_sn(&dev, devFd);
|
int err = airspy_open_fd(&dev, devFd);
|
||||||
#endif
|
#endif
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
@ -26,13 +26,12 @@ if (MSVC)
|
|||||||
target_link_libraries(airspyhf_source PRIVATE airspyhf)
|
target_link_libraries(airspyhf_source PRIVATE airspyhf)
|
||||||
elseif (ANDROID)
|
elseif (ANDROID)
|
||||||
target_include_directories(airspyhf_source PUBLIC
|
target_include_directories(airspyhf_source PUBLIC
|
||||||
/mnt/android_sdr/libusb/libusb
|
/sdr-kit/${ANDROID_ABI}/include/libairspyhf
|
||||||
/mnt/android_sdr/airspyhf/libairspyhf/src
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(airspyhf_source PUBLIC
|
target_link_libraries(airspyhf_source PUBLIC
|
||||||
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
|
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
|
||||||
/mnt/android_sdr/output/libairspyhf/${ANDROID_ABI}/libairspyhf.so
|
/sdr-kit/${ANDROID_ABI}/lib/libairspyhf.so
|
||||||
)
|
)
|
||||||
else (MSVC)
|
else (MSVC)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
|
@ -132,7 +132,7 @@ public:
|
|||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
int err = airspyhf_open_sn(&dev, serial);
|
int err = airspyhf_open_sn(&dev, serial);
|
||||||
#else
|
#else
|
||||||
int err = airspyhf_open_sn(&dev, devFd);
|
int err = airspyhf_open_fd(&dev, devFd);
|
||||||
#endif
|
#endif
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
@ -24,13 +24,12 @@ if (MSVC)
|
|||||||
target_link_libraries(hackrf_source PRIVATE hackrf)
|
target_link_libraries(hackrf_source PRIVATE hackrf)
|
||||||
elseif (ANDROID)
|
elseif (ANDROID)
|
||||||
target_include_directories(hackrf_source PUBLIC
|
target_include_directories(hackrf_source PUBLIC
|
||||||
/mnt/android_sdr/libusb/libusb
|
/sdr-kit/${ANDROID_ABI}/include/libhackrf
|
||||||
/mnt/android_sdr/hackrf/host/libhackrf/src
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(hackrf_source PUBLIC
|
target_link_libraries(hackrf_source PUBLIC
|
||||||
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
|
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
|
||||||
/mnt/android_sdr/output/libhackrf/${ANDROID_ABI}/libhackrf.so
|
/sdr-kit/${ANDROID_ABI}/lib/libhackrf.so
|
||||||
)
|
)
|
||||||
else (MSVC)
|
else (MSVC)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
|
@ -248,7 +248,7 @@ private:
|
|||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
hackrf_error err = (hackrf_error)hackrf_open_by_serial(_this->selectedSerial.c_str(), &_this->openDev);
|
hackrf_error err = (hackrf_error)hackrf_open_by_serial(_this->selectedSerial.c_str(), &_this->openDev);
|
||||||
#else
|
#else
|
||||||
hackrf_error err = (hackrf_error)hackrf_open_by_fd(&_this->openDev, _this->devFd);
|
hackrf_error err = (hackrf_error)hackrf_open_by_fd(_this->devFd, &_this->openDev);
|
||||||
#endif
|
#endif
|
||||||
if (err != HACKRF_SUCCESS) {
|
if (err != HACKRF_SUCCESS) {
|
||||||
spdlog::error("Could not open HackRF {0}: {1}", _this->selectedSerial, hackrf_error_name(err));
|
spdlog::error("Could not open HackRF {0}: {1}", _this->selectedSerial, hackrf_error_name(err));
|
||||||
|
@ -23,14 +23,9 @@ if (MSVC)
|
|||||||
|
|
||||||
target_link_libraries(rtl_sdr_source PRIVATE rtlsdr)
|
target_link_libraries(rtl_sdr_source PRIVATE rtlsdr)
|
||||||
elseif (ANDROID)
|
elseif (ANDROID)
|
||||||
target_include_directories(rtl_sdr_source PUBLIC
|
|
||||||
/mnt/android_sdr/libusb/libusb
|
|
||||||
/mnt/android_sdr/librtlsdr/include
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(rtl_sdr_source PUBLIC
|
target_link_libraries(rtl_sdr_source PUBLIC
|
||||||
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
|
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
|
||||||
/mnt/android_sdr/output/librtlsdr/${ANDROID_ABI}/librtlsdr.so
|
/sdr-kit/${ANDROID_ABI}/lib/librtlsdr.so
|
||||||
)
|
)
|
||||||
else (MSVC)
|
else (MSVC)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
|
@ -285,7 +285,7 @@ private:
|
|||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
int oret = rtlsdr_open(&_this->openDev, _this->devId);
|
int oret = rtlsdr_open(&_this->openDev, _this->devId);
|
||||||
#else
|
#else
|
||||||
int oret = rtlsdr_open(&_this->openDev, _this->devFd);
|
int oret = rtlsdr_open_fd(&_this->openDev, _this->devFd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (oret < 0) {
|
if (oret < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user