X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=7791b1b138daa601b888f1f59ffe1c1d445e95c3;hb=fe94bf8255145410d1673880932d59573c829b0e;hp=add9c02f9923464ba02ed981022b49c899ad8b0f;hpb=d8cdab78d434fa575ec3adc61b61cab252a2a8ed;p=pulseview.git diff --git a/CMakeLists.txt b/CMakeLists.txt index add9c02f..7791b1b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,29 @@ else() endif() endif() +# Check availability of features which depend on library versions. +# TODO Ideally use check_symbol_exists() instead, reduce boilerplate. +if(ENABLE_DECODE) + include(CheckCSourceCompiles) + include(CMakePushCheckState) + cmake_push_check_state() + set(CMAKE_REQUIRED_INCLUDES "${PKGDEPS_INCLUDE_DIRS}") + set(CMAKE_REQUIRED_LIBRARIES "sigrokdecode") + foreach (LPATH ${PKGDEPS_LIBRARY_DIRS}) + list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-L${LPATH}") + endforeach () + check_c_source_compiles(" + #include + int main(int argc, char *argv[]) + { + (void)argc; + (void)argv; + return srd_session_send_eof(NULL); + } + " HAVE_SRD_SESSION_SEND_EOF) + cmake_pop_check_state() +endif() + #=============================================================================== #= System Introspection #-------------------------------------------------------------------------------