summaryrefslogtreecommitdiffstats
path: root/cmake/FindIlbc.cmake
diff options
context:
space:
mode:
authorThomas Groman <tgroman@nuegia.net>2020-09-21 15:08:56 -0700
committerThomas Groman <tgroman@nuegia.net>2020-09-21 15:08:56 -0700
commit4aa31001bae125293466d582c2ed1dca441c1103 (patch)
tree5a2bdfc6d6b0ea1f94c53e7c7108d7108940f8c5 /cmake/FindIlbc.cmake
parenteffdcc9b1cf185f24e67d9e627a77d823bcfef8f (diff)
parentb7965d023cb68bce6d9495eb6afbc73206c1afef (diff)
downloadtwinkle-4aa31001bae125293466d582c2ed1dca441c1103.tar
twinkle-4aa31001bae125293466d582c2ed1dca441c1103.tar.gz
twinkle-4aa31001bae125293466d582c2ed1dca441c1103.tar.lz
twinkle-4aa31001bae125293466d582c2ed1dca441c1103.tar.xz
twinkle-4aa31001bae125293466d582c2ed1dca441c1103.zip
Merge branch 'master' into jackaudiojackaudio
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)