mirror of https://github.com/saitohirga/WSJT-X.git
Configure option for older version of Hamlib caching
This commit is contained in:
parent
aae93e0d82
commit
fff5644858
|
@ -907,6 +907,7 @@ message (STATUS "hamlib_LIBRARY_DIRS: ${hamlib_LIBRARY_DIRS}")
|
||||||
|
|
||||||
set (CMAKE_REQUIRED_INCLUDES "${hamlib_INCLUDE_DIRS}")
|
set (CMAKE_REQUIRED_INCLUDES "${hamlib_INCLUDE_DIRS}")
|
||||||
set (CMAKE_REQUIRED_LIBRARIES "${hamlib_LIBRARIES}")
|
set (CMAKE_REQUIRED_LIBRARIES "${hamlib_LIBRARIES}")
|
||||||
|
check_symbol_exists (CACHE_ALL "hamlib/rig.h" HAVE_HAMLIB_OLD_CACHING)
|
||||||
check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING)
|
check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
|
|
||||||
#include "moc_HamlibTransceiver.cpp"
|
#include "moc_HamlibTransceiver.cpp"
|
||||||
|
|
||||||
|
#if HAVE_HAMLIB_OLD_CACHING
|
||||||
|
#define HAMLIB_CACHE_ALL CACHE_ALL
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
// Unfortunately bandwidth is conflated with mode, this is probably
|
// Unfortunately bandwidth is conflated with mode, this is probably
|
||||||
|
@ -606,7 +610,7 @@ int HamlibTransceiver::do_start ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_HAMLIB_CACHING
|
#if HAVE_HAMLIB_CACHING || HAVE_HAMLIB_OLD_CACHING
|
||||||
// we must disable Hamlib caching because it lies about frequency
|
// we must disable Hamlib caching because it lies about frequency
|
||||||
// for less than 1 Hz resolution rigs
|
// for less than 1 Hz resolution rigs
|
||||||
auto orig_cache_timeout = rig_get_cache_timeout_ms (rig_.data (), HAMLIB_CACHE_ALL);
|
auto orig_cache_timeout = rig_get_cache_timeout_ms (rig_.data (), HAMLIB_CACHE_ALL);
|
||||||
|
@ -653,7 +657,7 @@ int HamlibTransceiver::do_start ()
|
||||||
resolution = -1; // best guess
|
resolution = -1; // best guess
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_HAMLIB_CACHING
|
#if HAVE_HAMLIB_CACHING || HAVE_HAMLIB_OLD_CACHING
|
||||||
// revert Hamlib cache timeout
|
// revert Hamlib cache timeout
|
||||||
rig_set_cache_timeout_ms (rig_.data (), HAMLIB_CACHE_ALL, orig_cache_timeout);
|
rig_set_cache_timeout_ms (rig_.data (), HAMLIB_CACHE_ALL, orig_cache_timeout);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,6 +19,7 @@ extern "C" {
|
||||||
#cmakedefine PROJECT_SAMPLES_URL "@PROJECT_SAMPLES_URL@"
|
#cmakedefine PROJECT_SAMPLES_URL "@PROJECT_SAMPLES_URL@"
|
||||||
#cmakedefine PROJECT_SUMMARY_DESCRIPTION "@PROJECT_SUMMARY_DESCRIPTION@"
|
#cmakedefine PROJECT_SUMMARY_DESCRIPTION "@PROJECT_SUMMARY_DESCRIPTION@"
|
||||||
|
|
||||||
|
#cmakedefine01 HAVE_HAMLIB_OLD_CACHING
|
||||||
#cmakedefine01 HAVE_HAMLIB_CACHING
|
#cmakedefine01 HAVE_HAMLIB_CACHING
|
||||||
|
|
||||||
#cmakedefine01 WSJT_SHARED_RUNTIME
|
#cmakedefine01 WSJT_SHARED_RUNTIME
|
||||||
|
|
Loading…
Reference in New Issue