summaryrefslogtreecommitdiffstats
path: root/cmake/FindIlbc.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindIlbc.cmake')
-rw-r--r--cmake/FindIlbc.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/FindIlbc.cmake b/cmake/FindIlbc.cmake
index f66ca55..7bbffa9 100644
--- a/cmake/FindIlbc.cmake
+++ b/cmake/FindIlbc.cmake
@@ -1,8 +1,27 @@
+include (CMakePushCheckState)
+include (CheckCXXSourceCompiles)
+
FIND_PATH(ILBC_INCLUDE_DIR ilbc/iLBC_decode.h)
FIND_LIBRARY(ILBC_LIBRARIES NAMES ilbc)
IF(ILBC_INCLUDE_DIR AND ILBC_LIBRARIES)
SET(ILBC_FOUND TRUE)
+
+ # Check if libilbc can be used without 'extern "C"'
+ CMAKE_PUSH_CHECK_STATE()
+ LIST(APPEND CMAKE_REQUIRED_INCLUDES "${ILBC_INCLUDE_DIR}")
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "-lilbc")
+ SET(CMAKE_REQUIRED_QUIET TRUE)
+ CHECK_CXX_SOURCE_COMPILES("
+ #include <ilbc/iLBC_decode.h>
+
+ int main() {
+ iLBC_Dec_Inst_t *iLBCdec_inst;
+ initDecode(iLBCdec_inst, 0, 0);
+ return 0;
+ }
+ " ILBC_CPP)
+ CMAKE_POP_CHECK_STATE()
ENDIF(ILBC_INCLUDE_DIR AND ILBC_LIBRARIES)
IF(ILBC_FOUND)